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 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"); } }