Font​Icon Font​Icon Font​Icon Class

Definition

Represents an icon that uses a glyph from the specified font.

public : class FontIcon : IconElement, IFontIcon, IFontIcon2, IFontIcon3public class FontIcon : IconElement, IFontIcon, IFontIcon2, IFontIcon3Public Class FontIcon Inherits IconElement Implements IFontIcon, IFontIcon2, IFontIcon3
<FontIcon .../>
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited properties

Inherited events

Inherited methods

Examples

This example shows an AppBarToggleButton with a FontIcon.

<AppBarToggleButton Label="FontIcon" Click="AppBarButton_Click">
    <AppBarToggleButton.Icon>
        <FontIcon FontFamily="Candara" Glyph="&#x03A3;"/>
    </AppBarToggleButton.Icon>
</AppBarToggleButton>

Remarks

Use FontIcon to specify an AppBarButton icon using a font glyph that's not included in the Symbol enumeration. You must specify the FontFamily and the Glyph value.

You can set the MirroredWhenRightToLeft property to have the glyph appear mirrored when the FlowDirection is RightToLeft. You typically use this property when a FontIcon is used to display an icon as part of a control template and the icon needs to be mirrored along with the rest of the control.

Note

You can set the Foreground property on the AppBarButton or on the FontIcon. If you set the Foreground on the AppBarButton, it's applied only to the default visual state. It's not applied to the other visual states defined in the AppBarButton template, like MouseOver. If you set the Foreground on the FontIcon, the color is applied to all visual states.

Constructors

FontIcon() FontIcon() FontIcon()

Initializes a new instance of the FontIcon class.

public : FontIcon()public FontIcon()Public Sub New()
Attributes

Properties

FontFamily FontFamily FontFamily

Gets or sets the font used to display the icon glyph.

public : FontFamily FontFamily { get; set; }public FontFamily FontFamily { get; set; }Public ReadWrite Property FontFamily As FontFamily
<FontIcon FontFamily="fontFamilyValue"/>
Value
FontFamily FontFamily FontFamily

The font used to display the icon glyph.

Attributes

FontFamilyProperty FontFamilyProperty FontFamilyProperty

Gets the identifier for the FontFamily dependency property.

public : static DependencyProperty FontFamilyProperty { get; }public static DependencyProperty FontFamilyProperty { get; }Public Static ReadOnly Property FontFamilyProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the FontFamily dependency property.

Attributes

FontSize FontSize FontSize

Gets or sets the size of the icon glyph.

public : double FontSize { get; set; }public double FontSize { get; set; }Public ReadWrite Property FontSize As double
<FontIcon FontSize="double" .../>
Value
double double double

A non-negative value that specifies the font size, measured in pixels.

Attributes

Remarks

The unit measure for FontSize is pixels, measuring the line height of the characters in the font. The apparent size of text in the UI can vary based on the current scaling. If you want to use different FontSize values for different scalings, you can do this using the resources system.

FontSizeProperty FontSizeProperty FontSizeProperty

Gets the identifier for the FontSize dependency property.

public : static DependencyProperty FontSizeProperty { get; }public static DependencyProperty FontSizeProperty { get; }Public Static ReadOnly Property FontSizeProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the FontSize dependency property.

Attributes

FontStyle FontStyle FontStyle

Gets or sets the font style for the icon glyph.

public : FontStyle FontStyle { get; set; }public FontStyle FontStyle { get; set; }Public ReadWrite Property FontStyle As FontStyle
<FontIcon FontStyle="fontStyleMemberName"/>
Value
FontStyle FontStyle FontStyle

A named constant of the enumeration that specifies the style in which the icon glyph is rendered. The default is Normal.

Attributes

FontStyleProperty FontStyleProperty FontStyleProperty

Gets the identifier for the FontStyle dependency property.

public : static DependencyProperty FontStyleProperty { get; }public static DependencyProperty FontStyleProperty { get; }Public Static ReadOnly Property FontStyleProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the FontStyle dependency property.

Attributes

FontWeight FontWeight FontWeight

Gets or sets the thickness of the icon glyph.

public : FontWeight FontWeight { get; set; }public FontWeight FontWeight { get; set; }Public ReadWrite Property FontWeight As FontWeight
<FontIcon FontWeight="fontWeightsValue"/>
Value
FontWeight FontWeight FontWeight

A value that specifies the thickness of the icon glyph. The default is Normal.

Attributes

FontWeightProperty FontWeightProperty FontWeightProperty

Gets the identifier for the FontWeight dependency property.

public : static DependencyProperty FontWeightProperty { get; }public static DependencyProperty FontWeightProperty { get; }Public Static ReadOnly Property FontWeightProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the FontWeight dependency property.

Attributes

Glyph Glyph Glyph

Gets or sets the character code that identifies the icon glyph.

public : PlatForm::String Glyph { get; set; }public string Glyph { get; set; }Public ReadWrite Property Glyph As string
<FontIcon Glyph="characterCode"/>
Value
PlatForm::String string string

The hexadecimal character code for the icon glyph.

Attributes

GlyphProperty GlyphProperty GlyphProperty

Gets the identifier for the Glyph dependency property.

public : static DependencyProperty GlyphProperty { get; }public static DependencyProperty GlyphProperty { get; }Public Static ReadOnly Property GlyphProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the Glyph dependency property.

Attributes

IsTextScaleFactorEnabled IsTextScaleFactorEnabled IsTextScaleFactorEnabled

Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.

public : PlatForm::Boolean IsTextScaleFactorEnabled { get; set; }public bool IsTextScaleFactorEnabled { get; set; }Public ReadWrite Property IsTextScaleFactorEnabled As bool
<FontIcon IsTextScaleFactorEnabled="bool"/>
Value
PlatForm::Boolean bool bool

true if automatic text enlargement is enabled; otherwise, false.

Attributes
See Also

IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty

Identifies the IsTextScaleFactorEnabled dependency property.

public : static DependencyProperty IsTextScaleFactorEnabledProperty { get; }public static DependencyProperty IsTextScaleFactorEnabledProperty { get; }Public Static ReadOnly Property IsTextScaleFactorEnabledProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the IsTextScaleFactorEnabled dependency property.

Attributes

MirroredWhenRightToLeft MirroredWhenRightToLeft MirroredWhenRightToLeft

Gets or sets a value that indicates whether the icon is mirrored when the FlowDirection is RightToLeft.

public : PlatForm::Boolean MirroredWhenRightToLeft { get; set; }public bool MirroredWhenRightToLeft { get; set; }Public ReadWrite Property MirroredWhenRightToLeft As bool
Value
PlatForm::Boolean bool bool

true if the icon is mirrored when the FlowDirection is FlowDirection.RightToLeft; otherwise, false. The default is false.

Attributes

Remarks

You can set the MirroredWhenRightToLeft property to have the glyph appear mirrored when the FlowDirection is RightToLeft. You typically use this property when a FontIcon is used to display an icon as part of a control template and the icon needs to be mirrored along with the rest of the control.

See Also

MirroredWhenRightToLeftProperty MirroredWhenRightToLeftProperty MirroredWhenRightToLeftProperty

Identifies the MirroredWhenRightToLeft dependency property.

public : static DependencyProperty MirroredWhenRightToLeftProperty { get; }public static DependencyProperty MirroredWhenRightToLeftProperty { get; }Public Static ReadOnly Property MirroredWhenRightToLeftProperty As DependencyProperty
Value
DependencyProperty DependencyProperty DependencyProperty

The identifier for the MirroredWhenRightToLeft dependency property.

Attributes
See Also

See Also