protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { // For now, we push useless information onto the cache to keep everything else working if (e.NavigationMode is NavigationMode.New) { ComicItemGridCache.PushStack(this.NavigationTag, this.PageName, new ComicItemGridState(new(), 0, this.MainViewModel.LastModified)); } // Ideally this should be automated this.ViewModel.RemoveEventHandlers(); }
protected override void OnNavigatingFrom(NavigatingCancelEventArgs e) { if (this.ComicItemGrid is null) { throw new ProgrammerError("Navigating out of a ComicNavigationItemPage that wasn't initialized."); } if (e.NavigationMode is NavigationMode.New) { ComicItemGridCache.PushStack(this.NavigationTag, this.ComicItem.Title, this.ComicItemGrid.GetSaveState()); } // Ideally this should be automated this.viewModel !.RemoveEventHandlers(); this.ComicItemGrid.DisposeAndInvalidate(); }