From ffe69102e1054ce5c4f13394d91c1f34e83325db Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Fri, 7 Oct 2011 18:50:08 +0000 Subject: [PATCH] Wizard: fixed bug when trying to navigate to the previous page (first page) from the second WizardPage in the Items collection. --- .../Samples.Modules.Wizard/Views/HomeView.xaml | 16 +++++++++++++++- .../Wizard/Implementation/Wizard.cs | 4 ++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/HomeView.xaml b/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/HomeView.xaml index fc607b26..7b8902a0 100644 --- a/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/HomeView.xaml +++ b/ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/HomeView.xaml @@ -5,6 +5,20 @@ xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" Title="Wizard"> - + + + + + + diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/Wizard.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/Wizard.cs index 4fb02d0a..fc0df23f 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/Wizard.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/Wizard.cs @@ -307,7 +307,7 @@ namespace Microsoft.Windows.Controls //no previous page defined so use index var currentIndex = Items.IndexOf(CurrentPage); var previousPageIndex = currentIndex - 1; - if (previousPageIndex > 0 && previousPageIndex < Items.Count) + if (previousPageIndex >= 0 && previousPageIndex < Items.Count) previousPage = Items[previousPageIndex] as WizardPage; } } @@ -416,7 +416,7 @@ namespace Microsoft.Windows.Controls //lets use an index to find the next page var currentIndex = Items.IndexOf(CurrentPage); var previousPageIndex = currentIndex - 1; - if (previousPageIndex > 0 && previousPageIndex < Items.Count) + if (previousPageIndex >= 0 && previousPageIndex < Items.Count) exists = true; }