Freigeben über


AppNotificationComboBox.Items Eigenschaft

Definition

Dient zum Abrufen oder Festlegen der Elemente für ein AppNotificationComboBox-

public:
 property IMap<Platform::String ^, Platform::String ^> ^ Items { IMap<Platform::String ^, Platform::String ^> ^ get(); void set(IMap<Platform::String ^, Platform::String ^> ^ value); };
IMap<winrt::hstring, winrt::hstring const&> Items();

void Items(IMap<winrt::hstring, winrt::hstring const&> value);
public IDictionary<string,string> Items { get; set; }
var iMap = appNotificationComboBox.items;
appNotificationComboBox.items = iMap;
Public Property Items As IDictionary(Of String, String)

Eigenschaftswert

IMap<String,String>

IDictionary<String,String>

IMap<Platform::String,Platform::String>

IMap<winrt::hstring,winrt::hstring>

Ein Wörterbuch mit Schlüssel-Wert-Paaren, die die IDs darstellen und Text für die Kombinationsfeldelemente anzeigen.

Beispiele

Das folgende Beispiel veranschaulicht die Verwendung dieser Eigenschaft zum Hinzufügen von Elementen zum Kombinationsfeld für App-Benachrichtigungen.

var comboBox = new AppNotificationComboBox("combobox_id");
comboBox.Title = "Select an item:";
comboBox.Items = new Dictionary<string, string> { { "id_one", "Item one" }, { "id_two", "Item two" } };
comboBox.SelectedItem = "id_one";

var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddComboBox(comboBox)
    .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>
        <input id='combobox_id' type='selection' title='Select an item:' defaultInput='id_one'>
            <selection id='id_one' content='Item one'/>
            <selection id='id_two' content='Item two'/>
        </input>
    </actions>
</toast>

Hinweise

Sie können einem Kombinationsfeld für App-Benachrichtigungen auch Elemente hinzufügen, indem Sie AppNotificationComboBox.AddItem-aufrufen.

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: