AppNotificationButton.Arguments Property
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.
Gets or sets the arguments associated with the AppNotificationButton.
public:
property IMap<Platform::String ^, Platform::String ^> ^ Arguments { IMap<Platform::String ^, Platform::String ^> ^ get(); void set(IMap<Platform::String ^, Platform::String ^> ^ value); };
IMap<winrt::hstring, winrt::hstring const&> Arguments();
void Arguments(IMap<winrt::hstring, winrt::hstring const&> value);
public IDictionary<string,string> Arguments { get; set; }
var iMap = appNotificationButton.arguments;
appNotificationButton.arguments = iMap;
Public Property Arguments As IDictionary(Of String, String)
Property Value
A dictionary of key/value pairs representing the app notification button arguments.
Examples
The following example shows the usage of this property to add arguments to an app notification button.
var args = new Dictionary<string, string>() { { "action", "reply" }, { "arg2", "value" } };
var button = new AppNotificationButton("Reply");
button.Arguments = args;
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.AddButton(button)
.BuildNotification();
AppNotificationManager.Default.Show(notification);
The resulting XML payload:
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Notification text.</text>
</binding>
</visual>
<actions>
<action content='Reply' arguments='action=reply;arg2=value'/><
/actions>
</toast>
Remarks
App notification button arguments added with this method are passed to the activated application when the user clicks on the button. You can add multiple arguments to each button. You can retrieve the arguments added with this method, or add multiple arguments in one call, by accessing the AppNotificationActivatedEventArgs.Arguments property.
You can also add individual arguments by calling AppNotificationButton.AddArgument).
For guidance on using the AppNotificationBuilder APIs to create the UI forapp notifications, see App notification content.
For reference information about the XML schema for app notifications, see App notification content schema.