AppNotificationButton.Content プロパティ

定義

AppNotificationButton のボタン テキストを取得または設定します。

public:
 property Platform::String ^ Content { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Content();

void Content(winrt::hstring value);
public string Content { get; set; }
var string = appNotificationButton.content;
appNotificationButton.content = string;
Public Property Content As String

プロパティ値

String

Platform::String

winrt::hstring

ボタン テキストを含む文字列。

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

var args = new Dictionary<string, string>() { { "action", "reply" }, { "arg2", "value" } };
var button = new AppNotificationButton();
button.Content = "Reply";
button.Arguments = args;

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

AppNotificationManager.Default.Show(notification);

結果の XML ペイロード:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <action content='Reply' arguments='action=reply;arg2=value'/>
    </actions>
</toast>

注釈

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

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

適用対象