ToastContentBuilder.AddText Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Add text to the toast.
public Microsoft.Toolkit.Uwp.Notifications.ToastContentBuilder AddText (string text, Microsoft.Toolkit.Uwp.Notifications.AdaptiveTextStyle? hintStyle = default, bool? hintWrap = default, int? hintMaxLines = default, int? hintMinLines = default, Microsoft.Toolkit.Uwp.Notifications.AdaptiveTextAlign? hintAlign = default, string language = default);
member this.AddText : string * Nullable<Microsoft.Toolkit.Uwp.Notifications.AdaptiveTextStyle> * Nullable<bool> * Nullable<int> * Nullable<int> * Nullable<Microsoft.Toolkit.Uwp.Notifications.AdaptiveTextAlign> * string -> Microsoft.Toolkit.Uwp.Notifications.ToastContentBuilder
Public Function AddText (text As String, Optional hintStyle As Nullable(Of AdaptiveTextStyle) = Nothing, Optional hintWrap As Nullable(Of Boolean) = Nothing, Optional hintMaxLines As Nullable(Of Integer) = Nothing, Optional hintMinLines As Nullable(Of Integer) = Nothing, Optional hintAlign As Nullable(Of AdaptiveTextAlign) = Nothing, Optional language As String = Nothing) As ToastContentBuilder
Parameters
- text
- String
Custom text to display on the tile.
- hintStyle
- Nullable<AdaptiveTextStyle>
This property is not used. Setting this has no effect.
This property is not used. Setting this has no effect. If you need to disable wrapping, set hintMaxLines to 1.
- hintAlign
- Nullable<AdaptiveTextAlign>
hintAlign is not used. Setting this has no effect.
- language
- String
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.
Returns
The current instance of ToastContentBuilder
Exceptions
Throws when attempting to add/reserve more than 4 lines on a single toast.
Throws when hintMaxLines
value is larger than 2.
Remarks
More info at: https://docs.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/adaptive-interactive-toasts#text-elements