-api-id | -api-type |
---|---|
T:Microsoft.Windows.AppNotifications.Builder.AppNotificationDuration |
winrt enum |
Specifies the duration for which an AppNotification is displayed.
The default duration.
Long duration.
Set the duration for an app notification by calling AppNotificationBuilder.SetDuration.
The following example demonstrates setting the duration in the XML payload for an app notification.
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.SetDuration(AppNotificationDuration.Long)
.BuildNotification();
AppNotificationManager.Default.Show(notification);
The resulting XML payload:
<toast duration='long'>
<visual>
<binding template='ToastGeneric'>
<text>Notification text.</text>
</binding>
</visual>
</toast>