AppNotificationButton.SetContextMenuPlacement メソッド

定義

通知のコンテキスト メニューにアプリ通知ボタンを配置することを要求します。

public:
 virtual AppNotificationButton ^ SetContextMenuPlacement() = SetContextMenuPlacement;
AppNotificationButton SetContextMenuPlacement();
public AppNotificationButton SetContextMenuPlacement();
function setContextMenuPlacement()
Public Function SetContextMenuPlacement () As AppNotificationButton

戻り値

追加のメソッド呼び出しをチェーンできるように 、AppNotificationButton インスタンスを返します。

次の例では、このメソッドを使用して、アプリ通知ボタンのコンテキスト メニューの配置を設定する方法を示します。

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddButton(new AppNotificationButton("Reply")
        .AddArgument("action", "reply")
        .SetContextMenuPlacement())
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

緊急のシナリオがサポートされている場合の結果の XML ペイロード:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <action content='Reply' arguments='action=reply' placement='contextMenu'/>
    </actions>
</toast>

注釈

AppNotificationButton.ContextMenuPlacement プロパティを使用して、コンテキスト メニューの配置値を設定することもできます。

AppNotificationBuilder API を使用して UI forapp 通知を作成する方法については、「アプリ通知の内容」を参照してください。

アプリ通知の XML スキーマのリファレンス情報については、「アプリ 通知コンテンツ スキーマ」を参照してください。

適用対象