private void SwipeDelete_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { dynamic output = args.SwipeControl.DataContext; System.Guid inkId = output.InkId; switch (output.Type) { case "Ink": using (var db = new LocalStorageContext()) { var ink = db.Memes.Remove(db.Memes.Find(inkId)); db.SaveChanges(); ReLoadNotes(); } break; case "Bookmark": using (var db = new LocalStorageContext()) { var ink = db.Memes.Remove(db.Memes.Find(inkId)); db.SaveChanges(); ReLoadNotes(); } break; } }
private void SwipeDownload_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { if (args.SwipeControl.DataContext is EpisodeWithState target) { DownloadEpisode(target.Episode); } }
private async void DeleteSwipeItem_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { if (args.SwipeControl.DataContext is IStorageFolder storageFolder) { await ViewModel.RemoveLocationAsync(storageFolder); } }
// Favorite the particular item, and then close the container. private void FavoriteSwipeItem_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { if (args.SwipeControl.DataContext is Episode episode) { FavoriteEpisode(episode); } }
private BookCard GetBookCardFromSwipe(SwipeItemInvokedEventArgs args) { var item = args.SwipeControl.DataContext as BookData; if (item == null) { return(null); } var container = uiBookList.ContainerFromItem(item) as ListViewItem; if (container == null) { return(null); } var swipe = container.ContentTemplateRoot as SwipeControl; if (swipe == null) { return(null); } var bookcard = swipe.Content as BookCard; if (bookcard == null) { return(null); } return(bookcard); }
private void BookmarkSwipeDelete_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { Bookmark bookmark = args.SwipeControl.DataContext as Bookmark; _item.DeleteBookmark(bookmark.ID); BookmarksView.Items.Remove(bookmark); }
private void SwipeUnfavorite_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { if (args.SwipeControl.DataContext is EpisodeWithState target) { RemoveFavoritedEpisode(target.Episode); } }
private void Delete_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { ViewUserTask._tasks.Remove((TaskModel)args.SwipeControl.DataContext); TaskModel swipedTask = (TaskModel)args.SwipeControl.DataContext; TaskDB.RemoveTask(swipedTask.TaskId); }
private void SwipeItem_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { if (args.SwipeControl.DataContext is DiscordChannel channel) { channel.Muted = !channel.Muted; } }
private void SwipeItemDeleteHoloLens_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { var target = args.SwipeControl.DataContext as HoloLens; HoloLensManager.Instance.RemoveManagedHoloLens(target); ApplicationData.Current.LocalSettings.Values["data"] = HoloLensManager.Instance.SerializeToJson(); }
private void swipeDelete_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { if (args.SwipeControl.DataContext is EpisodeWithState target) { if (target.Episode != null) { DeleteDownload(target.Episode); } } }
private void DeleteItem_ItemInvoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { Item data = (Item)args.SwipeControl.DataContext; if (data != null) { ItemsDataSource.GetData().Remove(data); ItemSelected = -1; } }
private async void Delete_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { var danmu = args.SwipeControl.DataContext as FullDanmu; var success = await NetworkSet.ChangeDanmu(danmu.ID, true); if (!success) { return; } this.Danmus.Remove(args.SwipeControl.DataContext as FullDanmu); }
private async void Delete_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { var book = args.SwipeControl.DataContext as BookDetail; var success = await NetworkSet.ChangeWishlist(book.ID, false); if (!success) { return; } this.WishBooks.Remove(book); }
private async void OnSwipeDownload(SwipeItem sender, SwipeItemInvokedEventArgs args) { var bookcard = GetBookCardFromSwipe(args); if (bookcard == null) { return; } var bookData = bookcard.GetBookData(); await DoSwipeDownload(bookData); }
private void DeleteOne_ItemInvoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { isArchived = !isArchived; if (isArchived) { ((TextBlock)args.SwipeControl.Content).Text = "Archived - Swipe Left"; } else { ((TextBlock)args.SwipeControl.Content).Text = "Swipe Left"; } }
private void SwipeItemInvoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { // ensures that this method is invoked twice for only one swipe action. if (pastSender == sender) { textBlock.Text = "FailTest"; } else { textBlock.Text = sender.Text; } pastSender = sender; var peer = FrameworkElementAutomationPeer.CreatePeerForElement(this); peer.RaiseAutomationEvent(AutomationEvents.MenuClosed); }
private void DeleteItem_ItemInvoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { //var activeCategory = (ICategory)args.SwipeControl.DataContext; //var deleteConfirmation = new ContentDialog //{ // Title = "Delete Category", // PrimaryButtonText = "Delete", // SecondaryButtonText = "Cancel", // DefaultButton = ContentDialogButton.Primary, // Content = $"Do you want delete category \n '{activeCategory.Name}'?" //}; //var result = await deleteConfirmation.ShowAsync(); //if (result == ContentDialogResult.Primary) // ViewModel.DeleteCategory(activeCategory); }
private async void DeleteItem_ItemInvoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { var activeAccount = (IAccount)args.SwipeControl.DataContext; var deleteConfirmation = new ContentDialog { Title = "Delete Account", PrimaryButtonText = "Delete Account", SecondaryButtonText = "Cancel", DefaultButton = ContentDialogButton.Primary, Content = $"Do you want delete account \n '{activeAccount.Name}({activeAccount.Currency})'?" }; var result = await deleteConfirmation.ShowAsync(); if (result == ContentDialogResult.Primary) { ViewModel.DeleteAccount(activeAccount); } }
private void OnSwipeRemove(SwipeItem sender, SwipeItemInvokedEventArgs args) { var bookdb = BookDataContext.Get(); var bookcard = GetBookCardFromSwipe(args); if (bookcard == null) { return; } var bookData = bookcard.GetBookData(); var nd = CommonQueries.BookNavigationDataEnsure(bookdb, bookData); nd.NSwipeLeft++; CommonQueries.BookSaveChanges(bookdb); bookData = args.SwipeControl.DataContext as BookData; Books.Remove(bookData); }
private async void Edit_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { var danmu = args.SwipeControl.DataContext as FullDanmu; var orgContent = danmu.Content; var newContent = await Util.InputTextDialogAsync("Editing Bullet Screen", "Please input the content of your bullet screen", orgContent); if (newContent != null && newContent.Length > 0 && newContent != orgContent) { var success = await NetworkSet.ChangeDanmu(danmu.ID, false, newContent); if (!success) { return; } danmu.Content = newContent; danmu.EditTime = DateTime.Now; danmu.OnPropertyChanged("Content"); danmu.OnPropertyChanged("EditTime"); } }
private void Accept_ItemInvoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { isAccepted = !isAccepted; CheckAcceptFlagBool(args.SwipeControl); if (isAccepted) { FontIconSource cancelIcon = new FontIconSource() { Glyph = "\ue711" }; sender.IconSource = cancelIcon; sender.Text = "Cancel"; } else { FontIconSource acceptIcon = new FontIconSource() { Glyph = "\ue10B" }; sender.IconSource = acceptIcon; sender.Text = "Accept"; } }
private void Flag_ItemInvoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { isFlagged = !isFlagged; CheckAcceptFlagBool(args.SwipeControl); if (isFlagged) { FontIconSource filledFlagIcon = new FontIconSource() { Glyph = "\ueB4B" }; sender.IconSource = filledFlagIcon; sender.Text = "Unmark"; } else { FontIconSource flagIcon = new FontIconSource() { Glyph = "\ue129" }; sender.IconSource = flagIcon; sender.Text = "Flag"; } }
/// <summary> /// Method invoked when the user clicks on Add to Outlook Calendar (SwipeControl). /// </summary> /// <param name="sender"></param> /// <param name="args"></param> private async void SwipeItem_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) => AppointmentExtensions.CreateAppointmentFromAgendum((Agendum)args.SwipeControl.DataContext);
private async void DeleteItem_ItemInvoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { var activeTransaction = (ITransaction)args.SwipeControl.DataContext; await DeleteTransaction(activeTransaction); }
private void SwipeItemInvoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { LastSwipeInvoked.Text = $"{args.SwipeControl.DataContext}.{sender.Text}"; }
private void RightControl_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { RightCommandRequested?.Invoke(this, EventArgs.Empty); }
private async void Buy_Invoked(SwipeItem sender, SwipeItemInvokedEventArgs args) { var book = args.SwipeControl.DataContext as BookDetail; var bookId = book.ID; await Util.BuyBookAsync(bookId, book, this.WishBooks, this.notification); }
public void OnDeviceMoveRequested(SwipeItem sender, SwipeItemInvokedEventArgs args) { _contextActionProvider.HandleMoveRequested(this, args.SwipeControl.Content as FrameworkElement); }
public void OnDeviceRemoveRequested(SwipeItem sender, SwipeItemInvokedEventArgs args) { _contextActionProvider.HandleDeleteRequested(this); }