AppNotificationBuilder.AddTextBox Method

Definition

Overloads

AddTextBox(String)

Adds a text box to the XML payload for an app notification.

AddTextBox(String, String, String)

Adds a text box with the specified placeholder text and title to the XML payload for an app notification.

AddTextBox(String)

Adds a text box to the XML payload for an app notification.

C#
[Windows.Foundation.Metadata.Overload("AddTextBox")]
public AppNotificationBuilder AddTextBox(string id);

Parameters

id
String

The ID of the text box.

Returns

Returns the AppNotificationBuilder instance so that additional method calls can be chained.

Attributes

Examples

The following example demonstrates adding a text box to the XML payload for an app notification.

C#
var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddTextBox("textBox")
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

The resulting XML payload:

XML
<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <input id='textBox' type='text'/>
    </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.

Applies to

Windows App SDK 1.6 an aner Versiounen
Produkt Versiounen
Windows App SDK 1.2, 1.3, 1.4, 1.5, 1.6

AddTextBox(String, String, String)

Adds a text box with the specified placeholder text and title to the XML payload for an app notification.

C#
[Windows.Foundation.Metadata.Overload("AddTextBox2")]
public AppNotificationBuilder AddTextBox(string id, string placeHolderText, string title);

Parameters

id
String

The ID of the text box.

placeHolderText
String

The placeholder text displayed in the text box.

title
String

The title text which is displayed above the text box.

Returns

Returns the AppNotificationBuilder instance so that additional method calls can be chained.

Attributes

Examples

The following example demonstrates adding a text box to the XML payload for an app notification.

C#
var notification = new AppNotificationBuilder()
    .AddText("Notification text.")
    .AddTextBox("textBox", "Placeholder text", "Title")
    .BuildNotification();

AppNotificationManager.Default.Show(notification);

The resulting XML payload:

XML
<toast>
    <visual>
        <binding template='ToastGeneric'>
            <text>Notification text.</text>
        </binding>
    </visual>
    <actions>
        <input id='textBox' type='text' placeHolderContent='Placeholder text' title='Title'/>
    </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.

Applies to

Windows App SDK 1.6 an aner Versiounen
Produkt Versiounen
Windows App SDK 1.2, 1.3, 1.4, 1.5, 1.6