Exemplo n.º 1
0
 public void GoBack()
 {
     if (this._currentIndex > 0)
     {
         this._nextIndex   = this._currentIndex - 1;
         this._nextPageGen = null;
     }
 }
Exemplo n.º 2
0
 public void Navigate(PageCreationDelegate generator)
 {
     if (generator != null)
     {
         this._nextPageGen = generator;
         this._nextIndex   = this._currentIndex + 1;
     }
 }
Exemplo n.º 3
0
        internal virtual bool Navigator(FT800Device dc)
        {
            if (this._nextIndex == this._currentIndex)
            {
                return(false);
            }

            bool proceed = true;

            if (this._currentIndex >= 0)
            {
                var args = new NavigationLeaveArgs();
                args.GoingBack = this._nextIndex < this._currentIndex;
                ((Page)this.Content).InvokeBeforeLeave(dc, args);
                if (args.Cancel)
                {
                    proceed = false;
                }
            }

            if (proceed)
            {
                if (this._nextIndex > this._currentIndex)
                {
                    int len = this._navigationStack.Length;
                    if (this._nextPageGen != null)
                    {
                        if (this._nextIndex >= len)
                        {
                            var array = new PageCreationDelegate[len + 4];
                            this._navigationStack.CopyTo(array, 0);
                            this._navigationStack = array;
                        }

                        this._navigationStack[++this._currentIndex] = this._nextPageGen;
                    }
                    else if (this._nextIndex < len)
                    {
                        this._currentIndex = this._nextIndex;
                    }
                }
                else
                {
                    this._currentIndex = this._nextIndex;
                }

                Page current;
                this.Content = current = this._navigationStack[this._currentIndex]();
                current.InvokeEnter(dc);
                current.Invalidate(true);
                this._nextPageGen = null;
            }

            return(proceed);
        }