Freigeben über


AppNotificationComboBox.Title Eigenschaft

Definition

Dient zum Abrufen oder Festlegen des Titels für ein Kombinationsfeld für App-Benachrichtigungen.

public:
 property Platform::String ^ Title { Platform::String ^ get(); void set(Platform::String ^ value); };
winrt::hstring Title();

void Title(winrt::hstring value);
public string Title { get; set; }
var string = appNotificationComboBox.title;
appNotificationComboBox.title = string;
Public Property Title As String

Eigenschaftswert

String

Platform::String

winrt::hstring

Eine Zeichenfolge, die den Titel des Kombinationsfelds enthält.

Beispiele

Das folgende Beispiel veranschaulicht die Verwendung dieser Eigenschaft zum Festlegen des Titels für das 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 den Titel auch mit der AppNotificationComboBox.SetTitle-Eigenschaft festlegen.

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: