天天看點

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整理-使用使用者選擇主題的顔色和字型 ,差別兩者的不同點。