AppNotificationBuilder.AddComboBox(AppNotificationComboBox) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Adds a combo box to the XML payload for an app notification.
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
Parameters
- value
- AppNotificationComboBox
An AppNotificationComboBox object representing the combo box to be added to the notification.
Returns
Returns the AppNotificationBuilder instance so that additional method calls can be chained.
Examples
The following example demonstrates adding a combo box to an app notification.
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);
The resulting XML payload:
<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>
Remarks
Up to five input controls can be added to a single notification.
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.