原文:
WPF整理-XAML访问静态属性
"XAML provides an easy way to set values of properties—type converters and the extended property syntax allow for flexible setting of values. However, some things cannot be expressed as a simple value, such as setting a property to the value of some static property."
这个相对比较简单,知道就行,Code Snip如下:
<StackPanel> <Ellipse Stroke="Black" Height="50" Fill="{x:Static SystemColors.DesktopBrush}"/> <Rectangle Stroke="Black" Height="50" Fill="{x:Static SystemColors.ActiveCaptionBrush}"/> </StackPanel>
请对比:WPF整理-使用用户选择主题的颜色和字体 ,区别两者的不同点。