Sprache

AppNotificationButton.ToolTip Eigenschaft

Definition

Dient zum Abrufen oder Festlegen des QuickInfo-Texts für die App-Benachrichtigungsschaltfläche.

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

Eigenschaftswert

String

Platform::String

winrt::hstring

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

Beispiele

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

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

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 auch den QuickInfo-Text festlegen, indem Sie die AppNotificationButton.SetToolTip)-Methode aufrufen.

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