AppNotificationButton.ButtonStyle プロパティ

定義

ボタンのスタイルを取得または設定します。

public:
 property AppNotificationButtonStyle ButtonStyle { AppNotificationButtonStyle get(); void set(AppNotificationButtonStyle value); };
AppNotificationButtonStyle ButtonStyle();

void ButtonStyle(AppNotificationButtonStyle value);
public AppNotificationButtonStyle ButtonStyle { get; set; }
var appNotificationButtonStyle = appNotificationButton.buttonStyle;
appNotificationButton.buttonStyle = appNotificationButtonStyle;
Public Property ButtonStyle As AppNotificationButtonStyle

プロパティ値

ボタンのスタイルを指定する AppNotificationButtonStyle 列挙の値。

次の例は、このプロパティを使用してアプリ通知ボタンのスタイルを設定する方法を示しています。

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

AppNotificationManager.Default.Show(notification);

結果の XML ペイロード:

<toast useButtonStyle='true'>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <action content='Reply' arguments='action=reply' hint-buttonStyle='Critical'/>
    </actions>
</toast>

注釈

AppNotificationBuilder API を使用してアプリ通知用 UI を作成する方法のガイダンスについては、「アプリ通知のコンテンツ」を参照してください。

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

適用対象