protected ComicNavigationItemGridViewModel( IMainPageContent parent, MainViewModel appViewModel, NavigationTag navigationTag, ComicCollectionSortSelector initialSort ) : base(parent, appViewModel) { // Note: in the future, we may want to store this to remove the event handler switch (navigationTag) { case NavigationTag.Comics: throw new ProgrammerError("Cannot make of navigation item view model for work items"); case NavigationTag.Playlist: this.collections = this.MainViewModel.Playlists; this.collections.SetSort(initialSort); break; default: this.collections = this.MainViewModel.SortedComicCollectionsFor(navigationTag, initialSort); break; } this.collections.CollectionsChanged += this.Collections_CollectionsChanged; }
public ComicNavigationItemPageNavigationArguments( MainViewModel mainViewModel, NavigationTag navigationTag, ComicNavigationItem comicItem, ComicItemGridViewModelProperties?properties = null ) { this.MainViewModel = mainViewModel; this.NavigationTag = navigationTag; this.ComicItem = comicItem; this.Properties = properties; }
public static ComicNavigationItemGridViewModel ForViewModel( IMainPageContent parent, MainViewModel mainViewModel, NavigationTag navigationTag, ComicCollectionSortSelector initialSort, ComicItemGridState?savedState = null ) { var viewModel = new ComicNavigationItemGridViewModel(parent, mainViewModel, navigationTag, initialSort); if (savedState?.LastModified is { } lastModified&& lastModified == mainViewModel.LastModified) { viewModel.SetComicItems(savedState.Items); }
internal void AddTag(int xx, int yy) { var pos = GetPosition(xx, yy); var task = new Task(async() => { var tag = new NavigationTag( deviceResources, loader, GlobalRotator, pos); await tag.CreateDeviceDependentResourcesAsync(); tags.Add(tag); }); task.Start(); }
public ComicRootPageNavigationArguments(MainViewModel mainViewModel, NavigationTag navigationTag) { this.MainViewModel = mainViewModel; this.NavigationTag = navigationTag; }