SystemFonts是一個字型資源類, 它的用法在下面代碼中可以看出:
<Button Margin="10, 10, 5, 5" Grid.Column="0" Grid.Row="3"
FontSize="{x:Static SystemFonts.IconFontSize}"
FontWeight="{x:Static SystemFonts.MessageFontWeight}"
FontFamily="{x:Static SystemFonts.CaptionFontFamily}">
SystemFonts
</Button>
這段代碼對應的C#代碼是:
Button btncsharp = new Button();
btncsharp.Content = "SystemFonts";
btncsharp.Background = SystemColors.ControlDarkDarkBrush;
btncsharp.FontSize = SystemFonts.IconFontSize;
btncsharp.FontWeight = SystemFonts.MessageFontWeight;
btncsharp.FontFamily = SystemFonts.CaptionFontFamily;
cv1.Children.Add(btncsharp);
This example shows how to use the static resources of SystemFonts in order to style or customize a button.
這個例子示範了如何使用SystemFonts的靜態資源去定製一個button.
SystemFonts is a class that contains both system font values and resources that bind to the values, for example, CaptionFontFamily is a SystemFonts value and CaptionFontFamilyKey is a corresponding resource key.
SystemFonts類是一個既包含系統字型值又包含綁定到系統字型值的系統字型資源. 例如CaptionFontFamily是一個SystemFonts的值, 而CaptionFontFamilyKey是一個SystemFonts的資源關鍵字.