Guest User

Untitled

a guest
Dec 12th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. 67 private async void CreateBadgeAndTextTile_Click(object sender, RoutedEventArgs e)
  2. {
  3. if (!SecondaryTile.Exists(TEXT_TILE_ID))
  4. {
  5. SecondaryTile secondTile = new SecondaryTile(
  6. TEXT_TILE_ID,
  7. "LockText",//short name:磚上顯示的名字
  8. "LockScreen CS - Badge and tile text",//display name:搜尋APP時會顯示的名字
  9. "TEXT_ARGS",
  10. TileOptions.ShowNameOnLogo | TileOptions.ShowNameOnWideLogo,
  11. new Uri("ms-appx:///images/squareTile-sdk.png"),//方形logo
  12. new Uri("ms-appx:///images/tile-sdk.png")//wide logo
  13. );
  14. secondTile.LockScreenBadgeLogo = new Uri("ms-appx:///images/badgelogo-sdk.png");
  15. secondTile.LockScreenDisplayBadgeAndTileText = true;//在鎖定畫面上顯示badge通知
  16. //在特定矩形的位置上顯示預覽次要磚
  17. 83 bool isPinned = await secondTile.RequestCreateForSelectionAsync(GetElementRect((FrameworkElement) sender), Placement.Above);
  18. if (isPinned)
  19. {//成功釘選在開始畫面,則update tile content
  20. ITileWideText03 tileContent = TileContentFactory.CreateTileWideText03();
  21. tileContent.TextHeadingWrap.Text = "Text for the lock screen";
  22. tileContent.RequireSquareContent = false;
  23. 89 TileUpdateManager.CreateTileUpdaterForSecondaryTile(TEXT_TILE_ID).Update(tileContent.CreateNotification());
  24. rootPage.NotifyUser("Secondary tile created and updated. Go to PC settings to add it to the lock screen.", NotifyType.StatusMessage);
  25. }
  26. else
  27. {
  28. rootPage.NotifyUser("Tile not created.", NotifyType.ErrorMessage);
  29. }
  30.  
  31. } ...
Add Comment
Please, Sign In to add comment