public static async Task UpdateHelper(SecondaryTile tile, TileHelper notification) { if (tile.TileId == "____dummyApplicationTile") { Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForApplication().Update(notification.GetNotificacion()); BadgeUpdateManager.CreateBadgeUpdaterForApplication().Update(notification.GetBadge()); } else { tile.VisualElements.BackgroundColor = notification.BackgroundColor != null ? notification.BackgroundColor : tile.VisualElements.BackgroundColor; tile.DisplayName = (notification.Title != null && notification.Title != "") ? notification.Title : tile.DisplayName; Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForSecondaryTile(tile.TileId).Update(notification.GetNotificacion()); BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(tile.TileId).Update(notification.GetBadge()); await tile.UpdateAsync(); } }
public static async Task CreateHelper(Uri navigationUri, TileHelper xmlstring, bool wideSupport) { string tileId = SetNavigationUri(navigationUri); string shortName = xmlstring.Title; string arguments = "arg=defaultArg"; if (string.IsNullOrWhiteSpace(xmlstring.Title)) { shortName = "-NO DISPLAY NAME-"; } if (navigationUri != null) { char[] Sign = "%".ToCharArray(); var argsFromUri = tileId.Substring(tileId.IndexOf(Sign[0]) + 1, tileId.Length - (tileId.IndexOf(Sign[0]) + 1)); if (tileId.IndexOf(Sign[0]) > 0 && string.IsNullOrEmpty(argsFromUri)) { arguments = "arg=defaultArg"; } else { arguments = argsFromUri; } } Uri square150x150Logo = new Uri("ms-appx:///Assets/Square150x150Logo.scale-200.png"); Uri logoReference = new Uri("ms-appx:///Assets/ApplicationIcon.png"); Uri wideLogoReference = square150x150Logo; SecondaryTile Tile = new SecondaryTile(tileId); Tile.VisualElements.BackgroundColor = xmlstring.BackgroundColor != null ? xmlstring.BackgroundColor : Tile.VisualElements.BackgroundColor; Tile.Arguments = arguments; Tile.DisplayName = (xmlstring.Title != null && xmlstring.Title != "") ? xmlstring.Title : "-NO DISPLAY NAME-"; Tile.VisualElements.Square150x150Logo = square150x150Logo; Tile.VisualElements.Wide310x150Logo = wideSupport ? wideLogoReference : Tile.VisualElements.Wide310x150Logo; await Tile.RequestCreateAsync(); TileUpdateManager.CreateTileUpdaterForSecondaryTile(Tile.TileId).EnableNotificationQueue(true); Windows.UI.Notifications.TileUpdateManager.CreateTileUpdaterForSecondaryTile(Tile.TileId).Update(xmlstring.GetNotificacion()); BadgeUpdateManager.CreateBadgeUpdaterForSecondaryTile(Tile.TileId).Update(xmlstring.GetBadge()); }