Share via


AppNotificationBuilder.BuildNotification Method

Definition

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

public:
 virtual AppNotification ^ BuildNotification() = BuildNotification;
AppNotification BuildNotification();
public AppNotification BuildNotification();
function buildNotification()
Public Function BuildNotification () As AppNotification

Returns

An AppNotification object.

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);

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 AppNotificationManager.Show(AppNotification).

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.

Applies to