AppNotificationBuilder.AddTextBox 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.
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.
public:
virtual AppNotificationBuilder ^ AddTextBox(Platform::String ^ id) = AddTextBox;
/// [Windows.Foundation.Metadata.Overload("AddTextBox")]
AppNotificationBuilder AddTextBox(winrt::hstring const& id);
[Windows.Foundation.Metadata.Overload("AddTextBox")]
public AppNotificationBuilder AddTextBox(string id);
function addTextBox(id)
Public Function AddTextBox (id As String) As AppNotificationBuilder
Parameters
- id
-
String
Platform::String
winrt::hstring
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.
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.AddTextBox("textBox")
.BuildNotification();
AppNotificationManager.Default.Show(notification);
The resulting XML payload:
<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
AddTextBox(String, String, String)
Adds a text box with the specified placeholder text and title to the XML payload for an app notification.
public:
virtual AppNotificationBuilder ^ AddTextBox(Platform::String ^ id, Platform::String ^ placeHolderText, Platform::String ^ title) = AddTextBox;
/// [Windows.Foundation.Metadata.Overload("AddTextBox2")]
AppNotificationBuilder AddTextBox(winrt::hstring const& id, winrt::hstring const& placeHolderText, winrt::hstring const& title);
[Windows.Foundation.Metadata.Overload("AddTextBox2")]
public AppNotificationBuilder AddTextBox(string id, string placeHolderText, string title);
function addTextBox(id, placeHolderText, title)
Public Function AddTextBox (id As String, placeHolderText As String, title As String) As AppNotificationBuilder
Parameters
- id
-
String
Platform::String
winrt::hstring
The ID of the text box.
- placeHolderText
-
String
Platform::String
winrt::hstring
The placeholder text displayed in the text box.
- title
-
String
Platform::String
winrt::hstring
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.
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.AddTextBox("textBox", "Placeholder text", "Title")
.BuildNotification();
AppNotificationManager.Default.Show(notification);
The resulting XML payload:
<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.