TextBlock.FontStyle Property

July 28, 2014

Gets or sets the font style for the content in this element.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public FontStyle FontStyle { get; set; }
<TextBlock FontStyle="fontStylesValue"/>

XAML Values

fontStylesValue

A FontStyles property name, either Normal or Italic.

Property Value

Type: System.Windows.FontStyle
The requested font style, which is a FontStyle that is obtained from one of the FontStyles property values. The default is Normal.

Dependency property identifier field: FontStyleProperty

This property can select only from fonts that exist in a font family and the corresponding glyphs. Not all font families have an italic form available. Setting to Italic if using a font family that has no corresponding italic form font does not cause programmatic shear effect applied to the normal font glyphs, and the Normal form is used instead as a fallback. Font fallback behavior does not change the property value, the property will remain as the value you set it to despite whatever visual behavior results due to font fallback.

FontStyle settings for Run child elements override the settings on the containing TextBlock.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft