Skip to content

Latest commit

 

History

History
59 lines (37 loc) · 1.25 KB

File metadata and controls

59 lines (37 loc) · 1.25 KB
-api-id -api-type
T:Microsoft.Windows.AppNotifications.Builder.AppNotificationDuration
winrt enum

Microsoft.Windows.AppNotifications.Builder.AppNotificationDuration

-description

Specifies the duration for which an AppNotification is displayed.

-enum-fields

-field Default: 0

The default duration.

-field Long: 1

Long duration.

-remarks

Set the duration for an app notification by calling AppNotificationBuilder.SetDuration.

-see-also

-examples

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>