public ComicNavigationItemPageNavigationArguments(
     MainViewModel mainViewModel,
     NavigationTag navigationTag,
     ComicNavigationItem comicItem,
     ComicItemGridViewModelProperties?properties = null
     )
 {
     this.MainViewModel = mainViewModel;
     this.NavigationTag = navigationTag;
     this.ComicItem     = comicItem;
     this.Properties    = properties;
 }
예제 #2
0
        public async Task ShowEditNavigationItemDialogAsync(ComicNavigationItem item)
        {
            if (this.ViewModel is not ComicNavigationItemGridViewModel vm)
            {
                throw new ProgrammerError($"{nameof(this.ShowEditNavigationItemDialogAsync)} should not be called with a work item view model");
            }

            var helper = new EditNavigationItemDialogViewModel(vm, item.Title);

            _ = await new PagedContentDialog {
                Title = $"{vm.NavigationTag.Describe(capitalized: true)}: {item.Title}"
            }
            .NavigateAndShowAsync <TextInputDialogContent, TextInputDialogNavigationArguments>(
                new(
                    properties: TextInputDialogProperties.ForSavingChanges("Name"),
                    initialValue: item.Title,
                    asyncAction: helper.SaveAsync,
                    validate: helper.GetItemTitleInvalidReason
                    )
                );
        }