Exemple #1
0
        private void ExecuteSelectPreviousPage(object sender, ExecutedRoutedEventArgs e)
        {
            WizardPage previousPage = null;

            if (CurrentPage != null)
            {
                var eventArgs = new CancelRoutedEventArgs(PreviousEvent);
                this.RaiseEvent(eventArgs);
                if (eventArgs.Cancel)
                    return;

                //check previous page
                if (CurrentPage.PreviousPage != null)
                    previousPage = CurrentPage.PreviousPage;
                else
                {
                    //no previous page defined so use index
                    var currentIndex = Items.IndexOf(CurrentPage);
                    var previousPageIndex = currentIndex - 1;
                    if (previousPageIndex >= 0 && previousPageIndex < Items.Count)
                        previousPage = Items[previousPageIndex] as WizardPage;
                }
            }

            CurrentPage = previousPage;
        }
Exemple #2
0
        private void ExecuteSelectNextPage(object sender, ExecutedRoutedEventArgs e)
        {
            WizardPage nextPage = null;

            if (CurrentPage != null)
            {
                var eventArgs = new CancelRoutedEventArgs(NextEvent);
                this.RaiseEvent(eventArgs);
                if (eventArgs.Cancel)
                    return;

                //check next page
                if (CurrentPage.NextPage != null)
                    nextPage = CurrentPage.NextPage;
                else
                {
                    //no next page defined use index
                    var currentIndex = Items.IndexOf(CurrentPage);
                    var nextPageIndex = currentIndex + 1;
                    if (nextPageIndex < Items.Count)
                        nextPage = Items[nextPageIndex] as WizardPage;
                }
            }

            CurrentPage = nextPage;
        }