So, I needed a WPF Wizard. Poked around and found a few things, including a sample in the SDK as well as a few others floating around on the web.  However, none of them were as simple or as generic as fit my requirements.  So I rolled my own.

Here's how it works. If you want to create a new wizard, you need to create a user control to host the wizard. In the sample, it is called MyWizard and is hosted by Window2.  In MyWizard codebehind, I set the content of the entire control to the WizardContainer user control, which is generic and can be reused. Also in MyWizard, I tell the WizardContainer which UserControls are the pages by adding them to the userControlCollection. In the sample, I also set a DataContext, which then gets picked up by all the pages no problem.  Pretty simple, which I like. And, completely able to be styled in Blend. And, completely generic!

Download the sample.

Posted on January 25, 2009 20:28
Actions: E-mail | Comments (0)

Comments


Add comment

Enter your name, handle, alias, or email.

We'll incarnate your avatar from the services below.