WPF 精修篇 获取系统颜色和字体样式
原创
©著作权归作者所有:来自51CTO博客作者朋克版小红帽的原创作品,请联系作者获取转载授权,否则将追究法律责任
看效果
<Grid>
<Rectangle Fill="{DynamicResource {x:Static SystemColors.DesktopBrushKey}}" HorizontalAlignment="Left" Height="76" Margin="85,70,0,0" Stroke="Black" VerticalAlignment="Top" Width="243">
</Rectangle>
<TextBlock Text=" 文本" FontFamily="{DynamicResource {x:Static SystemFonts.CaptionFontFamily}}" FontSize="{DynamicResource {x:Static SystemFonts.CaptionFontSize}}" FontWeight="{DynamicResource {x:Static SystemFonts.CaptionFontWeight}}"></TextBlock>
</Grid>
rectangle的fill 跟着窗体变化