AppNotificationButton.ToolTip プロパティ

定義

アプリ通知ボタンのツール ヒント テキストを取得または設定します。

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

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

プロパティ値

String

Platform::String

winrt::hstring

ツール ヒント テキストを含む文字列。

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

var button = new AppNotificationButton("Reply")
    .AddArgument("action", "reply");

if (AppNotificationButton.IsToolTipSupported())
{
    button.ToolTip = "Click to reply.";
}

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' hint-toolTip='Click to reply'/>
    </actions>
</toast>

注釈

AppNotificationButton.SetToolTip メソッドを呼び出して、ツール ヒント テキストを設定することもできます。

ツール ヒント テキストは、Windows 10 ビルド 19041 以降でのみサポートされています。 AppNotificationButton.IsToolTipSupported を呼び出して、実行時にツール ヒントが現在のデバイスでサポートされているかどうかを判断します。

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

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

適用対象