語言

AppNotificationButton.IsToolTipSupported 方法

定義

回傳一個值,表示目前裝置上應用程式通知按鈕是否支援工具提示。

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

傳回

Boolean

bool

如果支援工具提示,這是真的;否則,則為錯誤。

範例

以下範例示範檢查是否支援應用程式通知按鈕樣式。

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 Build 19041 及以上版本。 此方法可在執行時判斷目前裝置是否支援工具提示。

如需使用 AppNotificationBuilder API 來建立應用程式通知 UI 的指引,請參閱 應用程式通知內容。

如需應用程式通知 XML 架構的參考資訊,請參閱 應用程式通知內容架構。

適用於