AppNotificationBuilder.AddComboBox(AppNotificationComboBox) Methode

Definition

Fügt der XML-Nutzlast für eine App-Benachrichtigung ein Kombinationsfeld hinzu.

public:
 virtual AppNotificationBuilder ^ AddComboBox(AppNotificationComboBox ^ value) = AddComboBox;
AppNotificationBuilder AddComboBox(AppNotificationComboBox const& value);
public AppNotificationBuilder AddComboBox(AppNotificationComboBox value);
function addComboBox(value)
Public Function AddComboBox (value As AppNotificationComboBox) As AppNotificationBuilder

Parameter

value
AppNotificationComboBox

Ein AppNotificationComboBox -Objekt, das das Kombinationsfeld darstellt, das der Benachrichtigung hinzugefügt werden soll.

Gibt zurück

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

Beispiele

Das folgende Beispiel veranschaulicht das Hinzufügen eines Kombinationsfelds zu einer App-Benachrichtigung.

var notification = new AppNotificationBuilder()
    .AddText("Can you attend?")
    .AddComboBox(new AppNotificationComboBox("ComboBox")
        .AddItem("yes", "Going")
        .AddItem("maybe", "Maybe")
        .AddItem("no", "Decline")
        .SetSelectedItem("yes"))
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

Die resultierende XML-Nutzlast:

<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Can you attend?</text>
        </binding>
    </visual>
    <actions>
        <input id='ComboBox' type='selection' defaultInput='yes'>
            <selection id='maybe' content='Maybe'/><selection id='no' content='Decline'/>
            <selection id='yes' content='Going'/>
        </input>
    </actions>
</toast>

Hinweise

Bis zu fünf Eingabesteuerelemente können einer einzelnen Benachrichtigung hinzugefügt 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: