FontIcon FontIcon FontIcon Class

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

Syntax

Declaration

public class FontIconpublic class FontIconPublic Class FontIcon
<FontIcon .../>

Inheritance Hierarchy

Inherited Members

Inherited properties

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Tag
Tag
Tag
, , , , , , , , , , , , , , , , , , , , , , , , ,

Inherited events

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Inherited methods

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

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 FlowDirection. 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.

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>

Constructors summary

Initializes a new instance of the FontIcon class.

Properties summary

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

Gets the identifier for the FontFamily dependency property.

Gets or sets the size of the icon glyph.

Gets the identifier for the FontSize dependency property.

Gets or sets the font style for the icon glyph.

Gets the identifier for the FontStyle dependency property.

Gets or sets the thickness of the icon glyph.

Gets the identifier for the FontWeight dependency property.

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

Gets the identifier for the Glyph dependency property.

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

Identifies the IsTextScaleFactorEnabled dependency property.

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

Identifies the MirroredWhenRightToLeft dependency property.

Constructors

  • FontIcon()
    FontIcon()
    FontIcon()
    FontIcon()

    Initializes a new instance of the FontIcon class.

    public FontIcon()public New()Public Sub New()public FontIcon()

Properties

  • FontFamily
    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 FontFamilypublic FontFamily FontFamily { get; set; }
    <FontIcon FontFamily="fontFamilyValue"/>
    

    Property Value

  • FontFamilyProperty
    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 DependencyPropertypublic static DependencyProperty FontFamilyProperty { get; }

    Property Value

  • FontSize
    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 doublepublic double FontSize { get; set; }
    <FontIcon FontSize="double" .../>
    

    Property Value

    • double
      double
      double

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

    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
    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 DependencyPropertypublic static DependencyProperty FontSizeProperty { get; }

    Property Value

  • FontStyle
    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 FontStylepublic FontStyle FontStyle { get; set; }
    <FontIcon FontStyle="fontStyleMemberName"/>
    

    Property Value

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

  • FontStyleProperty
    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 DependencyPropertypublic static DependencyProperty FontStyleProperty { get; }

    Property Value

  • FontWeight
    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 FontWeightpublic FontWeight FontWeight { get; set; }
    <FontIcon FontWeight="fontWeightsValue"/>
    

    Property Value

  • FontWeightProperty
    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 DependencyPropertypublic static DependencyProperty FontWeightProperty { get; }

    Property Value

  • Glyph
    Glyph
    Glyph
    Glyph

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

    public string Glyph { get; set; }public string Glyph { get; set; }Public ReadWrite Property Glyph As stringpublic string Glyph { get; set; }
    <FontIcon Glyph="characterCode"/>
    

    Property Value

    • string
      string
      string

      The hexadecimal character code for the icon glyph.

  • GlyphProperty
    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 DependencyPropertypublic static DependencyProperty GlyphProperty { get; }

    Property Value

  • IsTextScaleFactorEnabled
    IsTextScaleFactorEnabled
    IsTextScaleFactorEnabled
    IsTextScaleFactorEnabled

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

    public bool IsTextScaleFactorEnabled { get; set; }public bool IsTextScaleFactorEnabled { get; set; }Public ReadWrite Property IsTextScaleFactorEnabled As boolpublic bool IsTextScaleFactorEnabled { get; set; }
    <FontIcon IsTextScaleFactorEnabled="bool"/>
    

    Property Value

    • bool
      bool
      bool

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

  • IsTextScaleFactorEnabledProperty
    IsTextScaleFactorEnabledProperty
    IsTextScaleFactorEnabledProperty
    IsTextScaleFactorEnabledProperty

    Identifies the IsTextScaleFactorEnabled dependency property.

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

    Property Value

  • MirroredWhenRightToLeft
    MirroredWhenRightToLeft
    MirroredWhenRightToLeft
    MirroredWhenRightToLeft

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

    public bool MirroredWhenRightToLeft { get; set; }public bool MirroredWhenRightToLeft { get; set; }Public ReadWrite Property MirroredWhenRightToLeft As boolpublic bool MirroredWhenRightToLeft { get; set; }

    Property Value

    Remarks

    You can set the MirroredWhenRightToLeft property to have the glyph appear mirrored when the FlowDirection is FlowDirection. 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.

  • MirroredWhenRightToLeftProperty
    MirroredWhenRightToLeftProperty
    MirroredWhenRightToLeftProperty
    MirroredWhenRightToLeftProperty

    Identifies the MirroredWhenRightToLeft dependency property.

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

    Property Value

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ComposableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Controls.dll