public async Task ShowMoveFilesDialogAsync(IEnumerable <ComicItem> items) { /* Currently, the application is not able to handle moving files while changing its author or title. So the * only thing we can actually change is category. We are thus limiting the ability to move files to moving * between the already-defined categories. */ var arguments = ItemPickerDialogNavigationArguments.New( properties: new ItemPickerDialogProperties( comboBoxHeader: "Category", action: "Move items", actionDescription: "Move selected items to the root folder of the following category:", warning: "Warning: this will move the folders containing the selected items to the root path of the chosen category. " + "There may not be an easy way to undo this operation." ), items: this.MainViewModel.Profile.RootPaths, action: category => { var comics = items.SelectMany(item => item.ContainedComics()).ToList(); _ = this.MainViewModel.StartMoveComicsToCategoryTaskAsync(comics, category); } ); _ = await new PagedContentDialog { Title = "Move files to a new category" }.NavigateAndShowAsync < ItemPickerDialogContent, ItemPickerDialogNavigationArguments >(arguments); }
public async Task ShowAddItemsToPlaylistDialogAsync(IEnumerable <ComicItem> items) { var arguments = ItemPickerDialogNavigationArguments.New( properties: new ItemPickerDialogProperties( comboBoxHeader: "Playlist", action: "Add to playlist", actionDescription: "Select a playlist to add the selected items to:", warning: "Note: the same item will only be added to the same playlist once." ), items: this.MainViewModel.Playlists.Keys, action: async selected => await this.MainViewModel.AddToPlaylistAsync(selected, items.SelectMany(item => item.ContainedComics())) ); _ = await new PagedContentDialog { Title = "Add items to a playlist " }.NavigateAndShowAsync < ItemPickerDialogContent, ItemPickerDialogNavigationArguments >(arguments); }