AppNotificationTextProperties Constructor

Definition

Initializes a new instance of the AppNotificationTextProperties class, which specifies display and localization properties for the text.

public:
 AppNotificationTextProperties();
 AppNotificationTextProperties();
public AppNotificationTextProperties();
function AppNotificationTextProperties()
Public Sub New ()

Examples

The following example demonstrates adding a text block to the XML payload for an app notification.

var notification = new AppNotificationBuilder()
    .AddText("Notification text.", new AppNotificationTextProperties().SetMaxLines(2))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

The resulting XML payload:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text hint-maxLines='2'>Notification text.</text>
        </binding>
    </visual>
</toast>

Remarks

Add text with text properties to an app notification by calling AppNotificationBuilder.AddText.

Applies to