Files
docs-desktop/dotnet-desktop-guide/framework/wpf/advanced/how-to-use-system-parameters-keys.md
T
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.6 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Use System Parameters Keys 03/30/2017
resource keys [WPF], SystemParameters class
classes [WPF], SystemParameters
77571283-d16c-45bb-9f69-cafbbf72b21e

How to: Use System Parameters 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.SystemParameters is a class that contains both system parameter values and resource keys that bind to the values—for example, xref:System.Windows.SystemParameters.FullPrimaryScreenHeight%2A and xref:System.Windows.SystemParameters.FullPrimaryScreenHeightKey%2A. System parameter metrics can be used as either static or dynamic resources. Use a dynamic resource if you want the parameter 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 parameter dynamic resources to style or customize a button. This XAML example sizes a button by assigning xref:System.Windows.SystemParameters values to the button's width and height.

Example

[!code-xamlSystemRes_snip#ParameterDynamicResources]

See also