private void UpdateTileWithText_Click(object sender, RoutedEventArgs e) { // Note: This sample contains an additional project, NotificationsExtensions. // NotificationsExtensions exposes an object model for creating notifications, but you can also // modify the strings directly. See UpdateTileWithTextWithStringManipulation_Click for an example // create the wide template ITileWideText03 tileContent = TileContentFactory.CreateTileWideText03(); tileContent.TextHeadingWrap.Text = "Hello World! My very own tile notification"; // Users can resize tiles to square or wide. // Apps can choose to include only square assets (meaning the app's tile can never be wide), or // include both wide and square assets (the user can resize the tile to square or wide). // Apps cannot include only wide assets. // Apps that support being wide should include square tile notifications since users // determine the size of the tile. // create the square template and attach it to the wide template ITileSquareText04 squareContent = TileContentFactory.CreateTileSquareText04(); squareContent.TextBodyWrap.Text = "Hello World! My very own tile notification"; tileContent.SquareContent = squareContent; // send the notification TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification()); OutputTextBlock.Text = MainPage.PrettyPrint(tileContent.GetContent()); }
void SendTileNotificationText_Click(object sender, RoutedEventArgs e) { ITileWideText03 tileContent = TileContentFactory.CreateTileWideText03(); // check out /en-US/resources.resw to understand where this string will come from tileContent.TextHeadingWrap.Text = "ms-resource:greeting"; ITileSquareText04 squareTileContent = TileContentFactory.CreateTileSquareText04(); squareTileContent.TextBodyWrap.Text = "ms-resource:greeting"; tileContent.SquareContent = squareTileContent; TileUpdateManager.CreateTileUpdaterForApplication().Update(tileContent.CreateNotification()); OutputTextBlock.Text = MainPage.PrettyPrint(tileContent.GetContent()); }