Share via


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 以获取可以传入 的 AppNotificationManager.Show(AppNotification)AppNotification 对象。

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

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

适用于