Problem with two pages that are instance of the same class


I have code that looks like this

Pages.Add(new APage());
Pages.Add(new BPage());
Pages.Add(new APage());
Pages.Add(new CPage());
Pages.Add(new DPage());

Notice that in lines 1 and 3 Im adding instances of the same Page class (APage) (they are different objets!). When I do this and I launch the wizard, when I click "Next" in the third page (the second instance of class APage) I return to the second page (BPage) instead of going to the CPage!!! Am I crazy? :)

(I'll test subclassing APage, in order not to repeat classes)


galactron wrote Jul 27, 2012 at 8:24 PM

I was wrong in my description of the problem. What actually happens is that when I click next in the BPage to go to the second APage, I return to the first APage instead!

galactron wrote Jul 27, 2012 at 9:10 PM

Ok, I got it. The wizard uses the Pages "Name" Property, so you need to make sure it is different for each page!