Contains properties that expose the system resources that concern fonts.
Assembly: PresentationFramework (in PresentationFramework.dll)
This example shows how to use the static resources of the class in order to style or customize a button.
System resources expose several system-determined values as both resources and properties in order to help you create visuals that are consistent with system settings. is a class that contains both system font values as static properties, and properties that reference resource keys that can be used to access those values dynamically at run time. For example, CaptionFontFamily is a value, and CaptionFontFamilyKey is a corresponding resource key.
In XAML, you can use the members of as either static properties or dynamic resource references (with the static property value as the key). Use a dynamic resource reference if you want the font metric to automatically update while the application runs; otherwise, use a static value reference.
The resource key s have the suffix " Key " appended to the property name.
The following example shows how to access and use the properties of as static values in order to style or customize a button. This markup example assigns values to a button.
To use the values of in code, you do not have to use either a static value or a dynamic resource reference. Instead, use the non-key properties of the class. Although the non-key properties are apparently defined as static properties, the run-time behavior of WPF as hosted by the system will reevaluate the properties in real time and will properly account for user-driven changes to system values. The following example shows how to specify the font settings of a button.
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);
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.