AppNotificationButton.ButtonStyle 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 style of a button.
public:
property AppNotificationButtonStyle ButtonStyle { AppNotificationButtonStyle get(); void set(AppNotificationButtonStyle value); };
AppNotificationButtonStyle ButtonStyle();
void ButtonStyle(AppNotificationButtonStyle value);
public AppNotificationButtonStyle ButtonStyle { get; set; }
var appNotificationButtonStyle = appNotificationButton.buttonStyle;
appNotificationButton.buttonStyle = appNotificationButtonStyle;
Public Property ButtonStyle As AppNotificationButtonStyle
Property Value
A value from the AppNotificationButtonStyle enumeration specifying the style of the button.
Examples
The following example shows the usage of this property to set the style of an app notification button.
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.AddButton(new AppNotificationButton("Reply")
.AddArgument("action", "reply")
.SetButtonStyle(AppNotificationButtonStyle.Critical))
.BuildNotification();
AppNotificationManager.Default.Show(notification);
The resulting XML payload:
<toast useButtonStyle='true'>
<visual>
<binding template='ToastGeneric'>
<text>Notification text.</text>
</binding>
</visual>
<actions>
<action content='Reply' arguments='action=reply' hint-buttonStyle='Critical'/>
</actions>
</toast>
Remarks
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.