當前位置: 首頁>>代碼示例>>C#>>正文


C# SecondaryTile.RequestDeleteAsync方法代碼示例

本文整理匯總了C#中Windows.UI.StartScreen.SecondaryTile.RequestDeleteAsync方法的典型用法代碼示例。如果您正苦於以下問題:C# SecondaryTile.RequestDeleteAsync方法的具體用法?C# SecondaryTile.RequestDeleteAsync怎麽用?C# SecondaryTile.RequestDeleteAsync使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Windows.UI.StartScreen.SecondaryTile的用法示例。


在下文中一共展示了SecondaryTile.RequestDeleteAsync方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: UnpinAsync

 public async Task<bool> UnpinAsync(string tileId)
 {
     System.Diagnostics.Contracts.Contract.Requires(tileId != null, "TileId");
     if (!SecondaryTile.Exists(tileId))
         return true;
     var tile = new SecondaryTile(tileId);
     return await tile.RequestDeleteAsync();
 }
開發者ID:ravirambles,項目名稱:Template10,代碼行數:8,代碼來源:SecondaryTileHelper.cs

示例2: UnpinTile

        public async Task<bool> UnpinTile(string tileId) {
            if (SecondaryTileExists(tileId)) {
                var secondaryTile = new SecondaryTile(tileId);
                bool isUnpinned = await secondaryTile.RequestDeleteAsync();
                return isUnpinned;
            }

            return true;
        }
開發者ID:ronlemire2,項目名稱:PrismRT-CodeGen,代碼行數:9,代碼來源:SecondaryTileService.cs

示例3: DeleteSecondaryTileAsync

 /// <summary>
 /// 移除輔助磁貼
 /// </summary>
 /// <param name="tileId">磁貼的唯一 ID</param>
 public async static Task DeleteSecondaryTileAsync(string tileId)
 {
     if (Windows.UI.StartScreen.SecondaryTile.Exists(tileId))
     {
         // First prepare the tile to be unpinned
         SecondaryTile secondaryTile = new SecondaryTile(tileId);
         // Now make the delete request.
         await secondaryTile.RequestDeleteAsync();
     }
 }
開發者ID:jevonsflash,項目名稱:Weather,代碼行數:14,代碼來源:SecondaryTileHelper.cs

示例4: UnPin

        public async Task<bool> UnPin(string pinnedItemId)
        {
            if (IsPinned(pinnedItemId))
            {
                var tile = new SecondaryTile(pinnedItemId);
                var result = await tile.RequestDeleteAsync();

                return result;
            }

            return false;
        }
開發者ID:derikwhittaker,項目名稱:Demo.LiveTiles,代碼行數:12,代碼來源:PinManager.cs

示例5: UnpinTile

        public async Task<bool> UnpinTile(string tileId)
        {
            if (SecondaryTileExists(tileId))
            {
                // <snippet810>
                var secondaryTile = new SecondaryTile(tileId);
                // </snippet810>
                // <snippet811>
                bool isUnpinned = await secondaryTile.RequestDeleteAsync();
                // </snippet811>
                return isUnpinned;
            }

            return true;
        }
開發者ID:stevenh77,項目名稱:ItineraryHunter-Win8,代碼行數:15,代碼來源:TileService.cs

示例6: UnpinTile

        /// <summary>
        /// UnPin a existed Tile.
        /// </summary>
        /// <param name="tileId"></param>
        /// <returns></returns>
        public async Task<bool> UnpinTile(string tileId)
        {
            // Create the unique tileId
            var id = Regex.Replace(tileId, @"[^\d\w\s]", "-").
                     Replace(" ", string.Empty) + ".LiveTile";

            //Check first if tile exists
            if (SecondaryTileExists(id))
            {
                var secondaryTile = new SecondaryTile(id);
                bool isUnpinned = await secondaryTile.RequestDeleteAsync();

                return isUnpinned;
            }

            return true;
        }
開發者ID:JavierErdozain,項目名稱:Events,代碼行數:22,代碼來源:TileService.cs

示例7: UnPinAsync

        public async Task<bool> UnPinAsync(ViewModels.DetailPageViewModel vm)
        {
            if (vm == null)
                throw new ArgumentNullException(nameof(vm));

            // already unpinned?
            if (!await IsPinned(vm))
                return true;

            try
            {
                var tile = new SecondaryTile(nameof(ViewModels.DetailPageViewModel));
                return await tile.RequestDeleteAsync();
            }
            catch (Exception)
            {
                System.Diagnostics.Debugger.Break();
                return false;
            }
        }
開發者ID:ravindrapro,項目名稱:Template10,代碼行數:20,代碼來源:TileService.cs

示例8: DeleteSecondaryTile

 public static async void DeleteSecondaryTile(string guid)
 {
     if (Windows.UI.StartScreen.SecondaryTile.Exists(guid))
     {
         SecondaryTile secondaryTile = new SecondaryTile(guid);
         await secondaryTile.RequestDeleteAsync();
     }
 }
開發者ID:liquidboy,項目名稱:X,代碼行數:8,代碼來源:Service.cs

示例9: PinButton_Click

        private async void PinButton_Click(object sender, RoutedEventArgs e)
        {
            var button = sender as AppBarToggleButton;
            var transform = button.TransformToVisual(pageRoot);
            Point location = transform.TransformPoint(new Point(0, 0));
            if (!SecondaryTile.Exists(ViewModel.SeriesId.ToString()))
            {
                Size size = new Size(150, 150);
                var bookmark = ViewModel.CreateBookmark();
                //ViewModel.IsLoading = true;
                var imageUri = await AppGlobal.CreateTileImageAsync(new Uri(bookmark.DescriptionImageUri));
                //ViewModel.IsLoading = false;
                string args = bookmark.Position.ToString();
                var tile = new SecondaryTile(ViewModel.SeriesId.ToString(), ViewModel.SeriesData.Title, args, imageUri, TileSize.Default);
                //var tile = new SecondaryTile(ViewModel.SeriesId.ToString(), "LightNovel", ViewModel.SeriesData.Title, args, TileOptions.ShowNameOnLogo, imageUri);
                try
                {
                    button.IsChecked = await tile.RequestCreateAsync(location);
                }
                catch (Exception)
                {
                }

                SyncPinButtonView();
            }
            else
            {
                var tile = new SecondaryTile(ViewModel.SeriesId.ToString());
                button.IsChecked = !await tile.RequestDeleteAsync(location);
                SyncPinButtonView();
            }
        }
開發者ID:fuchu,項目名稱:LightNovelClientWindows,代碼行數:32,代碼來源:ReadingPage.Shared.cs

示例10: PinToggleAsync

        public static async Task<bool> PinToggleAsync(Album album)
        {
            bool created;
            var id = "album." + album.Id;

            if (!SecondaryTile.Exists(id))
            {
                Insights.Track(
                    "Pin To Start",
                    new Dictionary<string, string>
                    {
                        {"DisplayName", album.Name},
                        {"ProviderId", album.ProviderId},
                        {"Type", "Album"}
                    });
                created =
                    await
                        CreatePin(
                            id,
                            album.Name,
                            "albums/" + album.Id,
                            string.Format(AppConstant.ArtworkPath, album.Id));
            }
            else
            {
                var secondaryTile = new SecondaryTile(id);
                created = !await secondaryTile.RequestDeleteAsync();
            }

            return created;
        }
開發者ID:jayharry28,項目名稱:Audiotica,代碼行數:31,代碼來源:CollectionHelper.cs

示例11: DeleteMenuFlyout_Click

        private async void DeleteMenuFlyout_Click(object sender, RoutedEventArgs e)
        {
            EventManage selectedEventManage = ((MenuFlyoutItem)sender).DataContext as EventManage;
            string EventFileTitle = selectedEventManage.EventFileTitle;
            StorageFile file = await applicationFolder.GetFileAsync(EventFileTitle);
            await file.DeleteAsync();
            refreshList();

            if (SecondaryTile.Exists(EventFileTitle))
            {
                SecondaryTile secondaryTile = new SecondaryTile(EventFileTitle);
                await secondaryTile.RequestDeleteAsync();
            }
        }
開發者ID:yyx290799684,項目名稱:WJZZ_WP_RT,代碼行數:14,代碼來源:MainPage.xaml.cs

示例12: RemoveSecondaryTile

 public async void RemoveSecondaryTile(string name)
 {
     if (TileExists(name))
     {
         var tile = new SecondaryTile("r" + name);
         await tile.RequestDeleteAsync();
     }
 }
開發者ID:Synergex,項目名稱:Baconography,代碼行數:8,代碼來源:LiveTileService.cs

示例13: PinUnpin

        /// <summary>
        /// Create/Remove Secondary Tile 
        /// </summary>
        public async Task PinUnpin()
        {
            // If SecondaryTile already exists, then remove it.
            if (SecondaryTile.Exists(appbarTileId + CurrentContact.Id))
            {
                // Unpin
                SecondaryTile secondaryTile = new SecondaryTile(appbarTileId + CurrentContact.Id);

                bool isUnpinned = await secondaryTile.RequestDeleteAsync();

                // Delete data from local folder if exists.
                StorageFolder localFolder = ApplicationData.Current.LocalFolder;
                try
                {
                    StorageFile File = await localFolder.GetFileAsync(CurrentContact.Id + ".png");
                    await File.DeleteAsync();
                }
                catch
                {
                    // If no file, do nothing
                }
            }
            else
            {
                Uri square150x150Logo;

                // If Contact has its own picture, then ues it for SecondayTile.
                if (CurrentContact.EntityImage != null)
                {
                    // Store the data to local Folder.
                    StorageFolder localFolder = ApplicationData.Current.LocalFolder;
                    // Create file
                    StorageFile File = await localFolder.CreateFileAsync(CurrentContact.Id + ".png", CreationCollisionOption.ReplaceExisting);

                    // Write data to file
                    using (Stream stream = await File.OpenStreamForWriteAsync())
                    {
                        var fs = new BinaryWriter(stream);
                        fs.Write(CurrentContact.EntityImage);
                    }

                    // Specify the saved file as SecondaryTile Icon.
                    square150x150Logo = new Uri("ms-appdata:///local/" + CurrentContact.Id + ".png");
                }
                else
                    // If Contact doesn't have picture, then use existing icon.
                    square150x150Logo = new Uri("ms-appx:///Assets/icon-contact.png");

                // Set record Id as Activation Argument.
                string tileActivationArguments = CurrentContact.Id.ToString();
                // Set Contact FullName as display
                string displayName = CurrentContact.FullName;

                TileSize newTileDesiredSize = TileSize.Square150x150;

                // Instantiate Secondary tile by specifying above information.
                SecondaryTile secondaryTile = new SecondaryTile(appbarTileId + CurrentContact.Id,
                                                                displayName,
                                                                tileActivationArguments,
                                                                square150x150Logo,
                                                                newTileDesiredSize);
                // Display FullName to the tile.
                secondaryTile.VisualElements.ShowNameOnSquare150x150Logo = true;

                // Create SecondaryTile
                bool isPinned = await secondaryTile.RequestCreateAsync();
            }
        }
開發者ID:kenakamu,項目名稱:Activity-Tracker-UWP,代碼行數:71,代碼來源:ActivityTrackerHelper.cs

示例14: btnUnpin_Click

        async private void btnUnpin_Click(object sender, RoutedEventArgs e)
        {
            int uniqueId = 1;

            SecondaryTile secondaryTile = new SecondaryTile("Pin_" + uniqueId.ToString());
            await secondaryTile.RequestDeleteAsync();

            this.btnPin.Visibility = Windows.UI.Xaml.Visibility.Visible;
            this.btnUnpin.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
        }
開發者ID:soreygarcia,項目名稱:Toolbox,代碼行數:10,代碼來源:MainPage.xaml.cs

示例15: Remove

 protected async Task Remove(SecondaryTile secondTile)
 {
     await secondTile.RequestDeleteAsync();
 }
開發者ID:M-Zuber,項目名稱:MoneyManager,代碼行數:4,代碼來源:Tile.cs


注:本文中的Windows.UI.StartScreen.SecondaryTile.RequestDeleteAsync方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。