Files
Andy (Steve) De George be103da07e Replace various WPF include files with content (#1335)
* net-current-v30plus-md.md

* net-current-v40plus-md.md

* tla2sharptla-ui-md.md

* tla2sharptla-uiautomation-md.md

* tla2sharptla-winclient-md.md

* tla2sharptla-xaml-md.md

* tlasharptla-ui-md.md

* tlasharptla-uiautomation-md.md

* tlasharptla-winclient-md.md

* tlasharptla-xaml-md.md

* fix warnings
2022-03-16 12:14:11 -04:00

1.5 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Use System Fonts Keys 03/30/2017
resource keys [WPF], SystemFonts class
036ebea7-5677-4f60-8ba4-56c9f9d9b8bd

How to: Use System Fonts Keys

System resources expose a number of system metrics as resources to help developers create visuals that are consistent with system settings. xref:System.Windows.SystemFonts is a class that contains both system font values and system font resources that bind to the values—for example, xref:System.Windows.SystemFonts.CaptionFontFamily%2A and xref:System.Windows.SystemFonts.CaptionFontFamilyKey%2A.

System font metrics can be used as either static or dynamic resources. Use a dynamic resource if you want the font metric to update automatically while the application runs; otherwise use a static resource.

Note

Dynamic resources have the keyword Key appended to the property name.

The following example shows how to access and use system font dynamic resources to style or customize a button. This XAML example creates a button style that assigns xref:System.Windows.SystemFonts values to a button.

Example

[!code-xamlSystemRes_snip#FontDynamicResources]

See also