AppNotificationComboBox.Title Property

Definition

Gets or sets the title for an app notification combo box.

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

Property Value

String

Platform::String

winrt::hstring

A string containing the title of the combo box.

Examples

The following example demonstrates the use of this property to set the title for the app notification combo box.

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

The resulting XML payload if the urgent scenario is supported:

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

Remarks

You can also set the title with the AppNotificationComboBox.SetTitle property.

For guidance on using the AppNotificationBuilder APIs to create the UI for app notifications, see App notification content.

For reference information about the XML schema for app notifications, see App notification content schema.

Applies to