AppNotificationButton.ButtonStyle Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit le style d’un bouton.
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
Valeur de propriété
Valeur de AppNotificationButtonStyle énumération spécifiant le style du bouton.
Exemples
L’exemple suivant montre l’utilisation de cette propriété pour définir le style d’un bouton de notification d’application.
var notification = new AppNotificationBuilder()
.AddText("Notification text.")
.AddButton(new AppNotificationButton("Reply")
.AddArgument("action", "reply")
.SetButtonStyle(AppNotificationButtonStyle.Critical))
.BuildNotification();
AppNotificationManager.Default.Show(notification);
Charge utile XML résultante :
<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>
Remarques
Pour obtenir des conseils sur l’utilisation des API AppNotificationBuilder pour créer l’interface utilisateur pour les notifications d’application, consultez contenu de notification d’application.
Pour plus d’informations sur le schéma XML pour les notifications d’application, consultez schéma de contenu de notification d’application.