Browse Source

Wizard: fixed bug when trying to navigate to the previous page (first page) from the second WizardPage in the Items collection.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
ffe69102e1
  1. 16
      ExtendedWPFToolkitSolution/Src/Samples/Modules/Samples.Modules.Wizard/Views/HomeView.xaml
  2. 4
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/Wizard.cs

16
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" xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
Title="Wizard"> Title="Wizard">
<Grid> <Grid>
<TextBlock Text="Wizard View" /> <extToolkit:Wizard FinishButtonClosesWindow="True">
<extToolkit:WizardPage x:Name="IntroPage"
Title="Welcome to my Wizard"
Description="This Wizard will walk you though how to do something." />
<extToolkit:WizardPage x:Name="Page1" PageType="Interior"
Title="Page 1"
Description="This is the first page in the process."/>
<extToolkit:WizardPage x:Name="Page2" PageType="Interior"
Title="Page 2"
Description="This is the second page in the process"/>
<extToolkit:WizardPage x:Name="LastPage" PageType="Interior"
Title="Last Page"
Description="This is the last page in the process"
CanFinish="True"/>
</extToolkit:Wizard>
</Grid> </Grid>
</infControls:DemoView> </infControls:DemoView>

4
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/Wizard/Implementation/Wizard.cs

@ -307,7 +307,7 @@ namespace Microsoft.Windows.Controls
//no previous page defined so use index //no previous page defined so use index
var currentIndex = Items.IndexOf(CurrentPage); var currentIndex = Items.IndexOf(CurrentPage);
var previousPageIndex = currentIndex - 1; var previousPageIndex = currentIndex - 1;
if (previousPageIndex > 0 && previousPageIndex < Items.Count) if (previousPageIndex >= 0 && previousPageIndex < Items.Count)
previousPage = Items[previousPageIndex] as WizardPage; previousPage = Items[previousPageIndex] as WizardPage;
} }
} }
@ -416,7 +416,7 @@ namespace Microsoft.Windows.Controls
//lets use an index to find the next page //lets use an index to find the next page
var currentIndex = Items.IndexOf(CurrentPage); var currentIndex = Items.IndexOf(CurrentPage);
var previousPageIndex = currentIndex - 1; var previousPageIndex = currentIndex - 1;
if (previousPageIndex > 0 && previousPageIndex < Items.Count) if (previousPageIndex >= 0 && previousPageIndex < Items.Count)
exists = true; exists = true;
} }

Loading…
Cancel
Save