Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

SystemFonts.MessageFontSizeKey Property

Gets the ResourceKey for the MessageFontSize property.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
public static ResourceKey MessageFontSizeKey { get; }
<object property="{DynamicResource {x:Static SystemFonts.MessageFontSizeKey}}"/>

Property Value

Type: System.Windows.ResourceKey
A resource key.

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

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.

NoteNote

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 SystemFonts values to a button.


<Style x:Key="SimpleFont" TargetType="{x:Type Button}">
    <Setter Property = "FontSize" Value= "{DynamicResource {x:Static SystemFonts.IconFontSizeKey}}"/>
    <Setter Property = "FontWeight" Value= "{DynamicResource {x:Static SystemFonts.MessageFontWeightKey}}"/>
    <Setter Property = "FontFamily" Value= "{DynamicResource {x:Static SystemFonts.CaptionFontFamilyKey}}"/>
</Style>


.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.