Cod*_*ray 15
您需要使用系统颜色画笔绘制背景.
该SystemColors.ControlBrushKey物业将返回ResourceKey适当的SolidColorBrush.
例如,要设置按钮的背景,可以使用以下代码:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowTitle="SystemColors Example" Background="White">
<StackPanel Margin="20">
<Button
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
Content="Hello, World!" />
</StackPanel>
</Page>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
27319 次 |
| 最近记录: |