Share via


AppNotificationButton.IsToolTipSupported Method

Definition

Returns a value indicating whether tool-tips are supported for app notification buttons on the current device.

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

Returns

Boolean

bool

True if tool-tips are supported; otherwise, false.

Examples

The following example demonstrates checking to see if the app notification button styles are supported.

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);

The resulting XML payload if the urgent scenario is supported:

<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>

Remarks

The AppNotificationButton.SetToolTip) method allows you to provide a tool-tip string that is displayed when the user mouses over the button. This feature is only supported for on Windows 10 Build 19041 and later. This method allows you to determine at runtime if tool-tips are supported on the current device.

For guidance on using the AppNotificationBuilder APIs to create the UI for app notifications, see App notification content.

For reference information about the XML schema for app notifications, see App notification content schema.

Applies to