Share via


AppNotificationButton.ToolTip Propriété

Définition

Obtient ou définit le texte de l’info-bulle pour le bouton de notification de l’application.

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

Valeur de propriété

String

Platform::String

winrt::hstring

Chaîne contenant le texte de l’info-bulle.

Exemples

L’exemple suivant illustre l’utilisation de cette propriété pour définir l’info-bulle pour le bouton de notification d’application.

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

Charge utile XML résultante si le scénario urgent est pris en charge :

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

Remarques

Vous pouvez également définir le texte de l’info-bulle en appelant la méthode AppNotificationButton.SetToolTip .

Le texte d’info-bulle n’est pris en charge que pour Windows 10 build 19041 et versions ultérieures. Appelez AppNotificationButton.IsToolTipSupported pour déterminer au moment de l’exécution si les info-conseils sont pris en charge sur l’appareil actuel.

Pour obtenir des conseils sur l’utilisation des API AppNotificationBuilder pour créer l’interface utilisateur pour les notifications d’application, consultez Contenu des notifications d’application.

Pour obtenir des informations de référence sur le schéma XML pour les notifications d’application, consultez Schéma de contenu de notification d’application.

S’applique à