Freigeben über


AppNotificationButton.SetToolTip(String) Methode

Definition

Legt den QuickInfo-Text für die App-Benachrichtigungsschaltfläche fest.

public:
 virtual AppNotificationButton ^ SetToolTip(Platform::String ^ value) = SetToolTip;
AppNotificationButton SetToolTip(winrt::hstring const& value);
public AppNotificationButton SetToolTip(string value);
function setToolTip(value)
Public Function SetToolTip (value As String) As AppNotificationButton

Parameter

value
String

Platform::String

winrt::hstring

Eine Zeichenfolge, die den QuickInfo-Text enthält.

Gibt zurück

Gibt die AppNotificationButton Instanz zurück, sodass zusätzliche Methodenaufrufe verkettet werden können.

Beispiele

Das folgende Beispiel veranschaulicht die Verwendung dieser Methode zum Festlegen der QuickInfo für die App-Benachrichtigungsschaltfläche.

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

Die resultierende XML-Nutzlast, wenn das dringende Szenario unterstützt wird:

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

Hinweise

Sie können den QuickInfo-Text auch mithilfe der AppNotificationButton.ToolTip-Eigenschaft festlegen.

QuickInfo-Text wird nur für Windows 10 Build 19041 und höher unterstützt. Rufen Sie AppNotificationButton.IsToolTipSupported auf, um zur Laufzeit zu ermitteln, ob Tooltipps auf dem aktuellen Gerät unterstützt werden.

Anleitungen zur Verwendung der AppNotificationBuilder--APIs zum Erstellen der Benutzeroberfläche für App-Benachrichtigungen finden Sie unter App-Benachrichtigungsinhalt.

Referenzinformationen zum XML-Schema für App-Benachrichtigungen finden Sie unter App-Benachrichtigungsinhaltsschema.

Gilt für: