Exemple #1
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);
        }
Exemple #2
0
 internal void InvokeBeforeLeave(FT800Device dc, NavigationLeaveArgs args)
 {
     this.OnBeforeLeave(dc, args);
 }
Exemple #3
0
 protected virtual void OnBeforeLeave(FT800Device dc, NavigationLeaveArgs args)
 {
 }