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.
<luglio 2024>
lunmarmergiovensabdom
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234
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