コード例 #1
0
        private void OnViewModelReadyToBind(object sender, Common.ThreadReadyToBindEventArgs args)
        {
            this.state = args.State;
            this._threadStack.Push(viewmodel);
            this.DataContext = viewmodel;
            this.ThreadInitializationPane.Visibility = System.Windows.Visibility.Collapsed;
            this.GoToIndex(args.State.PageNumber - 1);

            VisualStateManager.GoToState(this, "Reading", true);
        }
コード例 #2
0
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            base.OnNavigatingFrom(e);
            if (!e.IsNavigationInitiator)
            {
                this.state.Save(this);
            }

            else
            {
                this.state = null;
                this._threadStack.Clear();
            }
        }
コード例 #3
0
        private void BuildStateFromIsoStore()
        {
            state = ThreadViewPageState.Load();
            if (state == null)
            {
                BuildStateFromNavigationQuery();
            }

            else
            {
                bool refresh = viewmodel.Thread == null || viewmodel.Thread.ThreadID != state.ThreadID;
                refresh = refresh && (viewmodel.SelectedItem == null || viewmodel.SelectedItem.PageNumber != state.PageNumber);

                if (refresh)
                {
                    this.viewmodel.UpdateModel(state);
                    this.DataContext = viewmodel;
                    this.GoToIndex(state.PageNumber);
                }
            }
        }
コード例 #4
0
 public static void Save(ThreadViewPageState state)
 {
     state.SaveToFile(SAVE_FILE);
 }
コード例 #5
0
 public static void Save(ThreadViewPageState state)
 {
     state.SaveToFile(SAVE_FILE);
 }
コード例 #6
0
        private void OnViewModelReadyToBind(object sender, Common.ThreadReadyToBindEventArgs args)
        {
            this.state = args.State;
            this._threadStack.Push(viewmodel);
            this.DataContext = viewmodel;
            this.ThreadInitializationPane.Visibility = System.Windows.Visibility.Collapsed;
            this.GoToIndex(args.State.PageNumber - 1);

            VisualStateManager.GoToState(this, "Reading", true);
        }
コード例 #7
0
        private void BuildStateFromIsoStore()
        {
            state = ThreadViewPageState.Load();
            if (state == null)
            {
                BuildStateFromNavigationQuery();
            }

            else
            {
                bool refresh = viewmodel.Thread == null || viewmodel.Thread.ThreadID != state.ThreadID;
                refresh = refresh && (viewmodel.SelectedItem == null || viewmodel.SelectedItem.PageNumber != state.PageNumber);

                if (refresh)
                {
                    this.viewmodel.UpdateModel(state);
                    this.DataContext = viewmodel;
                    this.GoToIndex(state.PageNumber);
                }
            }
        }
コード例 #8
0
        protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            base.OnNavigatingFrom(e);
            if (!e.IsNavigationInitiator)
            {
                this.state.Save(this);
            }

            else
            {
                this.state = null;
                this._threadStack.Clear();
            }
        }