pch*_*jer 15
如果在元素的应用程序运行时更改了桌面颜色,则该元素将保持其原始颜色:
<Button>
<Button.Background>
<SolidColorBrush Color="{StaticResource {x:Static SystemColors.DesktopColorKey}}" />
</Button.Background>
Hello
</Button>
Run Code Online (Sandbox Code Playgroud)
另一方面,如果使用DynamicResource设置元素的颜色,则在桌面颜色更改时它会更改:
<Button>
<Button.Background>
<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.DesktopColorKey}}" />
</Button.Background>
Hello
</Button>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
26854 次 |
最近记录: |