This project has moved. For the latest updates, please go here.

Dynamic Page Generation

Sep 6, 2016 at 6:03 PM
Could you tell me how dynamicaly add page in wizard control.
Is it correct to use Commit event to add page?
How to add new page, but preserve selected page ?
In my example below i call RestartPage for second page and change selected page.
But how to change selection page for other pages ? Metod Previous raise exeption.

private void MainWizard_Load(object sender, EventArgs e)
    {            
        WizardPage page = new WizardPage();
        page.Commit += wizardPage_Commit;

        wizardControl.Pages.Add(page);

        WizardPage nextpage = new WizardPage();
        wizardControl.Pages.Add(nextpage);

        wizardControl.RestartPages();
    }

    void wizardPage_Commit(object sender, AeroWizard.WizardPageConfirmEventArgs e)
    {          
            wizardControl.Pages[wizardControl.Pages.Count-1].Commit += wizardPage_Commit;

            WizardPage nextpage = new WizardPage();
            wizardControl.Pages.Add(nextpage);
    }
Coordinator
Sep 10, 2016 at 2:35 PM
Edited Sep 10, 2016 at 2:37 PM
My first question is why do you need to dynamically add pages? The design concept behind the control is that you can visually build all of the pages and then use the navigation within the control the next page. In the Commit handler you use the NextPage method as the last call to specify the next page. See the help on Commits at https://aerowizard.codeplex.com/documentation.
Marked as answer by dahall on 2/5/2017 at 12:48 PM