Skip to content

Latest commit

 

History

History
43 lines (25 loc) · 1.68 KB

appnotificationbuilder_buildnotification_785085070.md

File metadata and controls

43 lines (25 loc) · 1.68 KB
-api-id -api-type
M:Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilder.BuildNotification
winrt method

Microsoft.Windows.AppNotifications.Builder.AppNotificationBuilder.BuildNotification

-description

Returns an AppNotification object representing the XML payload for an app notification.

-returns

An AppNotification object.

-remarks

Use the methods of the AppNotificationBuilder to assemble the elements you want to include in an app notification. Call BuildNotificaion to get an AppNotification object that you can pass into xref:Microsoft.Windows.AppNotifications.AppNotificationManager.Show(Microsoft.Windows.AppNotifications.AppNotification)?displayProperty=nameWithType.

For guidance on using the AppNotificationBuilder APIs to create the UI for app notifications, see App notification content.

For reference information about the XML schema for app notifications, see App notification content schema.

-see-also

-examples

The following example demonstrates building an AppNotification from an instance of AppNotificationBuilder.

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .BuildNotification();

AppNotificationManager.Default.Show(notification);