/// <summary> /// Create the secondary tile /// </summary> /// <param name="element">Element to pin</param> public async Task PinAsync(PinnableObject element) { SecondaryTile tile = new SecondaryTile { TileId = element.Id, ShortName = element.Title, DisplayName = element.Title, Arguments = element.Id, TileOptions = TileOptions.ShowNameOnLogo, Logo = new Uri("ms-appx:///Assets/Logo.png") }; if (await tile.RequestCreateAsync()) { // Tile template definition ITileSquarePeekImageAndText04 squareContent = TileContentFactory.CreateTileSquarePeekImageAndText04(); squareContent.TextBodyWrap.Text = element.Content; squareContent.Image.Src = element.ImageUrl; squareContent.Image.Alt = element.Content; // Tile creation TileNotification tileNotification = squareContent.CreateNotification(); // Send the notification TileUpdater tileUpdater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(element.Id); tileUpdater.Update(tileNotification); } }
public object Convert(object value, Type targetType, object parameter, string language) { string applicationName = ResourcesRsxAccessor.GetString("AppName"); PinnableObject pinnableObject = null; if (value is VisualGenericItem) { VisualGenericItem item = value as VisualGenericItem; pinnableObject = new PinnableObject { Id = string.Format("{0}-{1}-{2}", applicationName, item.Type, item.Id), Title = item.Title, ImageUrl = item.ImageUrl, Content = item.Title }; } else if (value is News) { News news = value as News; pinnableObject = new PinnableObject { Id = string.Format("{0}-News-{1}", applicationName, news.Id), Title = news.Title, ImageUrl = news.ImageUrl, Content = news.Title }; } else if (value is Conference) { Conference conference = value as Conference; pinnableObject = new PinnableObject { Id = string.Format("{0}-Conference-{1}", applicationName, conference.Id), Title = conference.Name, ImageUrl = conference.ImageUrl, Content = conference.Name }; } else if (value is Show) { Show salon = value as Show; pinnableObject = new PinnableObject { Id = string.Format("{0}-Show-{1}", applicationName, salon.Id), Title = salon.Name, ImageUrl = salon.ImageUrl, Content = salon.Name }; } return pinnableObject; }
/// <summary> /// Pin the news /// </summary> /// <param name="news">News transformed in adapted pinnable object</param> private void Pin(PinnableObject news) { PinTaskHelper.CreateTile(news as PinnableObjectWP); }
/// <summary> /// Informs the view the user wants to pin the selected item /// </summary> /// <param name="element">Selected item converted</param> private void Pin(PinnableObject element) { Messenger.Default.Send(element); }
/// <summary> /// Pin the selected conference /// </summary> /// <param name="element">Conference converted in a generic object to pin</param> private async void Pin(PinnableObject element) { CreateSecondaryTileHelper helper = new CreateSecondaryTileHelper(); await helper.PinAsync(element); }
/// <summary> /// Pin the show /// </summary> /// <param name="salon">Show transformed in adapted pinnable object</param> private void Pin(PinnableObject salon) { PinTaskHelper.CreateTile(salon as PinnableObjectWP); }
/// <summary> /// Pin the conference /// </summary> /// <param name="conference">Conference transformed in adapted pinnable object</param> private void Pin(PinnableObject conference) { PinTaskHelper.CreateTile(conference as PinnableObjectWP); }
/// <summary> /// Pin the displayed conference on the Start Screen /// </summary> /// <param name="conference">The conference converted in a generic object</param> private async void Pin(PinnableObject conference) { CreateSecondaryTileHelper helper = new CreateSecondaryTileHelper(); await helper.PinAsync(conference); }
/// <summary> /// Pin the selected show /// </summary> /// <param name="show">Element to pin</param> private async void Pin(PinnableObject show) { CreateSecondaryTileHelper helper = new CreateSecondaryTileHelper(); await helper.PinAsync(show); }