This project is read-only.
Project Description
WPF user control (not a custom control) for generically hosting multiple-step wizards. Uses MVVM, you create the model and view for each step and optionally configure steps that guide the wizard along a different workflow.

Upon looking for a WPF wizard control, I came across this project. It's a great implementation of a wizard, but I wanted a generic control. So I modified that project in the following ways:
  • Made it generic: The classes that support the wizard take a type parameter that is the type of the object to be modeled by the wizard. The current code uses the wizard to model the same object the original project did: CupOfCoffee.
  • Made the steps generic: The original project had the steps hard coded into the main wizard model's Xaml. In this project, the wizard model accepts a list of steps and the WizardView displays them dynamically.
  • Allow for varying paths through the wizard: Any step can be configured to jump to a different step in the wizard's complete list of steps. The display of all possible steps will reflect the change in "workflow."
  • Removed internationalization: I simply didn't have this requirement. Thus, I'd rather the UI just shows the actual names of enumerations of options (splitting the enum name into a readable display).

The basic steps for usage are:
  1. Figure out what all the steps will be (for all possible paths through the wizard).
  2. Designate an object with a parameter-less constructor to use as the "wizard business object." This guy contains all the user's selections.
  3. Create views and models for each step.
    1. Each step model descends from WizardStepViewModelBase.
    2. Set properties of WizardStepViewModelBase's instance of the wizard business object as necessary.
    3. If required, include a special option group that will change the workflow of the wizard.
    4. For your ViewModels, there are a few other "model" classes available to help:
      1. OptionViewModel for a radio button. In UI, bind to a MultiOptionGroupView for check box.
      2. RouteOptionViewModel for a radio button, the selection of which will "route" the user through different paths in the wiz.
    5. In each step view model, you can package the options into a collection and bind them to the wizard UI controls in your step view.
  4. Create an instance of WizardViewModel.
  5. Pass a list of the steps (CompleteStep: model and view) to it calling ProvideSteps.
    1. The order in which you add steps into the list passed to ProvideSteps is the order the steps will appear in the wiz. The wizard will modify the route (hiding / showing steps) as selections are made. See 3.4.2 above.
  6. Display the WizardView (WizardViewModel is it's DataContext).

- See WizardClassDiagram and the coffee wizard implementation for details.
- VS 2010 - 2013

Last edited May 23, 2014 at 6:17 PM by bradwood, version 8