private void InitPane() { List<PaneNavButton> Sections = new List<PaneNavButton>(); Sections.Add( new PaneNavButton( new IconTOC() { AutoScale = true }, typeof( TableOfContents ) ) ); Sections.Add( new PaneNavButton( new IconBookmark() { AutoScale = true }, typeof( BookmarkList ) ) ); Sections.Add( new PaneNavButton( new IconImage() { AutoScale = true }, typeof( ImageList ) ) ); Sections.Add( new PaneNavButton( new IconReload() { AutoScale = true }, Reload ) ); Sections.Add( new PaneNavButton( new IconFastForword() { AutoScale = true } , () => ContentView.GoTop() ) ); Sections.Add( new PaneNavButton( new IconFastForword() { AutoScale = true, Direction = Direction.MirrorVertical } , () => ContentView.GoBottom() ) ); Sections.Add( InertiaButton() ); if ( !MainStage.Instance.IsPhone ) Sections.Add( FullScreenButton() ); Sections.Add( FlowDirButton() ); Sections.Add( new PaneNavButton( new IconSettings() { AutoScale = true }, GotoSettings ) ); ContentPane = new NavPaneSection( this, Sections ); ContentPane.SelectSection( Sections[ 0 ] ); PaneGrid.DataContext = ContentPane; MainSplitView.PanelBackground = ContentPane.BackgroundBrush; Overlay.OnStateChanged += Overlay_OnStateChanged; }
void Dispose() { if ( Disposed ) return; Disposed = true; foreach ( Action p in RegKey ) p(); ClockStop(); NavigationHandler.OnNavigatedBack -= OnBackRequested; Window.Current.SizeChanged -= Current_SizeChanged; App.ViewControl.PropertyChanged -= VC_PropertyChanged; CurrentBook = null; CurrentChapter = null; ContentView?.Dispose(); ContentView = null; ES = null; ContentPane = null; }