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 架构的参考信息,请参阅 应用通知内容架构

适用于