共用方式為


AppNotificationButton.IsToolTipSupported 方法

定義

傳回值,指出目前裝置上的代理程式更新按鈕是否支援工具提示。

public:
 static bool IsToolTipSupported();
 static bool IsToolTipSupported();
public static bool IsToolTipSupported();
function isToolTipSupported()
Public Shared Function IsToolTipSupported () As Boolean

傳回

Boolean

bool

如果支援工具提示,則為 True;否則為 false。

範例

下列範例示範如何檢查是否支援代理程式更新按鈕樣式。

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

if (AppNotificationButton.IsToolTipSupported())
{
    button.SetToolTip("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 和更新版本。 此方法可讓您在執行時間判斷目前裝置是否支援工具提示。

如需使用 AppNotificationBuilder API 建立代理程式更新 UI 的指引,請參閱 代理程式更新內容

如需代理程式更新之 XML 架構的參考資訊,請參閱 代理程式更新內容架構

適用於