ATTENZIONE: Questo sito impiega diversi tipi di cookies. Alla pagina MAGGIORI INFORMAZIONI è possibile avere informazioni aggiuntive. Cliccando su ACCETTO o continuando a navigare sul sito acconsenti al loro utilizzo.
<aprile 2024>
lunmarmergiovensabdom
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345
Immagini  

UniversalApp - Notification

Aggiungere al progetto le classi della notification extension

 

Impostare il progetto come Toast Capable

notification1.png


Le notifiche Toast utilizzano un template XML, pertanto le classi di Notification Extension ci aiutano a nascondere la complessità dell'XML

 

                //INVIO UNA NOTIFICA PUSH

                IToastNotificationContent toastContent = null;

                IToastText02 templateContent = ToastContentFactory.CreateToastText02();

                templateContent.TextHeading.Text = "Stickers";

                templateContent.TextBodyWrap.Text = "You have " + numRichieste.ToString() + " requests";

                toastContent = templateContent;

 

                // Create a toast, then create a ToastNotifier object to show  the toast

                ToastNotification toast = toastContent.CreateNotification();

                ToastNotificationManager.CreateToastNotifier().Show(toast);

 

 

Aggiungere un BADGE ad una TILE

XmlDocument badgeXml = BadgeUpdateManager.GetTemplateContent(BadgeTemplateType.BadgeNumber);

           XmlElement badgeElement = (XmlElement)badgeXml.SelectSingleNode("/badge");

           badgeElement.SetAttribute("value", numRichieste.ToString());

           BadgeNotification badge = new BadgeNotification(badgeXml);

           BadgeUpdateManager.CreateBadgeUpdaterForApplication().Update(badge);

Notifiche