Edit

Share via


AdaptiveText Class

Definition

An adaptive text element.

public sealed class AdaptiveText : Microsoft.Toolkit.Uwp.Notifications.IAdaptiveChild, Microsoft.Toolkit.Uwp.Notifications.IAdaptiveSubgroupChild, Microsoft.Toolkit.Uwp.Notifications.ITileBindingContentAdaptiveChild, Microsoft.Toolkit.Uwp.Notifications.IToastBindingGenericChild
type AdaptiveText = class
    interface IAdaptiveChild
    interface IAdaptiveSubgroupChild
    interface ITileBindingContentAdaptiveChild
    interface IToastBindingGenericChild
Public NotInheritable Class AdaptiveText
Implements IAdaptiveChild, IAdaptiveSubgroupChild, ITileBindingContentAdaptiveChild, IToastBindingGenericChild
Inheritance
AdaptiveText
Implements

Constructors

AdaptiveText()

Properties

HintAlign

Gets or sets the horizontal alignment of the text. Note that for Toast, this property will only take effect if the text is inside an AdaptiveSubgroup.

HintMaxLines

Gets or sets the maximum number of lines the text element is allowed to display. For Tiles, this is infinity by default. For Toasts, top-level text elements will have varying max line amounts (and in the Anniversary Update you can change the max lines). Text on a Toast inside an AdaptiveSubgroup will behave identically to Tiles (default to infinity).

HintMinLines

Gets or sets the minimum number of lines the text element must display. Note that for Toast, this property will only take effect if the text is inside an AdaptiveSubgroup.

HintStyle

Gets or sets the style that controls the text's font size, weight, and opacity. Note that for Toast, the style will only take effect if the text is inside an AdaptiveSubgroup.

HintWrap

Gets or sets a value whether text wrapping is enabled. For Tiles, this is false by default. For Toasts, this is true on top-level text elements, and false inside an AdaptiveSubgroup. Note that for Toast, setting wrap will only take effect if the text is inside an AdaptiveSubgroup (you can use HintMaxLines = 1 to prevent top-level text elements from wrapping).

Language

Gets or sets the target locale of the XML payload, specified as a BCP-47 language tags such as "en-US" or "fr-FR". The locale specified here overrides any other specified locale, such as that in binding or visual. If this value is a literal string, this attribute defaults to the user's UI language. If this value is a string reference, this attribute defaults to the locale chosen by Windows Runtime in resolving the string.

Text

Gets or sets the text to display. Data binding support added in Creators Update, only works for toast top-level text elements.

Methods

ToString()

Returns the value of the Text property.

Applies to