FontIcon
FontIcon
FontIcon
FontIcon
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// This API is not available in Javascript.
<FontIcon .../>
- Inheritance
- Attributes
| 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="Σ"/>
</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
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 FontFamily// This API is not available in Javascript.
<FontIcon FontFamily="fontFamilyValue"/>
The font used to display the icon glyph.
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 DependencyProperty// This API is not available in Javascript.
The identifier for the FontFamily dependency property.
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 double// This API is not available in Javascript.
<FontIcon FontSize="double" .../>
- Value
- double 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 DependencyProperty// This API is not available in Javascript.
The identifier for the FontSize dependency property.
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 FontStyle// This API is not available in Javascript.
<FontIcon FontStyle="fontStyleMemberName"/>
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 DependencyProperty// This API is not available in Javascript.
The identifier for the FontStyle dependency property.
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 FontWeight// This API is not available in Javascript.
<FontIcon FontWeight="fontWeightsValue"/>
A value that specifies the thickness of the icon glyph. The default is Normal.
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 DependencyProperty// This API is not available in Javascript.
The identifier for the FontWeight dependency property.
Glyph 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// This API is not available in Javascript.
<FontIcon Glyph="characterCode"/>
- Value
- PlatForm::String 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 DependencyProperty// This API is not available in Javascript.
The identifier for the Glyph dependency property.
IsTextScaleFactorEnabled 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// This API is not available in Javascript.
<FontIcon IsTextScaleFactorEnabled="bool"/>
- Value
- PlatForm::Boolean bool bool bool
true if automatic text enlargement is enabled; otherwise, false.
- See Also
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 DependencyProperty// This API is not available in Javascript.
The identifier for the IsTextScaleFactorEnabled dependency property.
MirroredWhenRightToLeft 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// This API is not available in Javascript.
- Value
- PlatForm::Boolean bool bool bool
true if the icon is mirrored when the FlowDirection is FlowDirection.RightToLeft; otherwise, false. The default is false.
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 MirroredWhenRightToLeftProperty
Identifies the MirroredWhenRightToLeft dependency property.
public : static DependencyProperty MirroredWhenRightToLeftProperty { get; }public static DependencyProperty MirroredWhenRightToLeftProperty { get; }Public Static ReadOnly Property MirroredWhenRightToLeftProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the MirroredWhenRightToLeft dependency property.
- See Also