Cookie Consent by Free Privacy Policy Generator
Privacy
Polipone
<dicembre 2024>
lunmarmergiovensabdom
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
Immagini  

UniversalApp - Tile

 

Aggiungere al progetto le classi delle NOTIFICATION EXTENSION nella 000_LIB

 

TILE = icona sulla start page

BADGE = numeretto che indica quante notifiche attive ci sono

 

 

//PULISCO IL BADGE SULLA TILE - da mettere all'avvio dell'applicazione

BadgeUpdateManager.CreateBadgeUpdaterForApplication().Clear();

 

 

//CAMBIO IL BADGE DELLA TILE

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

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

badgeElement.SetAttribute("value", MIOVALORE);

BadgeNotification badge = new BadgeNotification(badgeXml);

BadgeUpdateManager.CreateBadgeUpdaterForApplication().Update(badge);

 

 

//CAMBIARE L'IMMAGINE DELLA TILE

 TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);

// Create a notification for the Square310x310 tile using one of the available templates for the size.

ITileSquare310x310Image tileContent = TileContentFactory.CreateTileSquare310x310Image();

tileContent.Image.Src = "ms-appx:///assets/Logo.scale-240.png";

tileContent.Image.Alt = "";

// Create a notification for the Wide310x150 tile using one of the available templates for the size.

ITileWide310x150ImageAndText01 wide310x150Content = TileContentFactory.CreateTileWide310x150ImageAndText01();

wide310x150Content.Image.Src = "ms-appx:///assets/WideLogo.scale-240.png";

wide310x150Content.Image.Alt = "";

// Create a notification for the Square150x150 tile using one of the available templates for the size.

ITileSquare150x150Image square150x150Content = TileContentFactory.CreateTileSquare150x150Image();

square150x150Content.Image.Src = "ms-appx:///assets/Logo.scale-240.png";

square150x150Content.Image.Alt = "";

 

// Attach the Square150x150 template to the Wide310x150 template.

wide310x150Content.Square150x150Content = square150x150Content;

// Attach the Wide310x150 to the Square310x310 template.

tileContent.Wide310x150Content = wide310x150Content;

// Send the notification to the application’s tile.

TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification());

Notifiche