语言

AppNotificationBuilder.BuildNotification 方法

定义

返回一个 AppNotification 对象,该对象表示应用通知的 XML 有效负载。

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

返回

AppNotification 对象。

示例

以下示例演示如何从 AppNotificationBuilder 实例生成 AppNotification。

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

AppNotificationManager.Default.Show(notification);

注解

使用 AppNotificationBuilder 的方法来组装想要包含在应用通知中的元素。 调用 BuildNotificaion 以获取可以传入 Microsoft.Windows 的 AppNotification 对象。AppNotifications.AppNotificationManager.Show。

有关使用 AppNotificationBuilder API 创建应用通知的 UI 的指导,请参阅 应用通知内容。

有关应用通知的 XML 架构的参考信息,请参阅 应用通知内容架构。

适用于