public WizardWindow() { InitializeComponent(); DataContext = this; MonoberryProjectWizardView = GetPlainWizardView(); this.BusinessObject = (MonoberryProjectWizardView.DataContext as WizardViewModel <MonoberryProjectObject>).BusinessObject; wizardHost.Children.Clear(); wizardHost.Children.Add(MonoberryProjectWizardView); this.FirePropsChanged(MonoberryProjectWizardView.DataContext as IWizardViewModel); }
/// <summary> /// /// </summary> /// <param name="genericModel">This is the instance created by the WizardViewModel</param> /// <returns></returns> private static List <CompleteStep <MonoberryProjectObject> > CreateMonoberryProjectSteps(MonoberryProjectObject genericModel) { /// 2.1) Create a view model for each step. /// Each of these descend from WizardStepViewModelBase var step1ViewModel = new WelcomeStepViewModel(genericModel); /// This ViewModel contains a RouteOptionGroupViewModel (a group of options that may alter the workflow of the wizard). /// See TypeSizeStepViewModel.CreateAvailableDrinkSizes. var step2ViewModel = new SDKConfigurationViewModel(genericModel); var step3ViewModel = new DeviceSetupViewModel(genericModel); var step4ViewModel = new ApplicationInfoViewModel(genericModel); var step5ViewModel = new FinishStepViewModel(genericModel); /// 2.2) Create a list of steps. /// We pass the same type param (CupOfCoffee) that we passed to WizardViewModel in Button_Click above. return(new List <CompleteStep <MonoberryProjectObject> >() { /// Each step contains a ViewModel and a View type (the type representing the actual Xaml to be shown). new CompleteStep <MonoberryProjectObject>() { ViewModel = step1ViewModel, ViewType = typeof(WelcomeView), Visited = true }, new CompleteStep <MonoberryProjectObject>() { ViewModel = step2ViewModel, ViewType = typeof(SDKConfigurationView) }, new CompleteStep <MonoberryProjectObject>() { ViewModel = step3ViewModel, ViewType = typeof(DeviceSetupView) }, new CompleteStep <MonoberryProjectObject>() { ViewModel = step4ViewModel, ViewType = typeof(ApplicationInfoView) }, new CompleteStep <MonoberryProjectObject>() { ViewModel = step5ViewModel, ViewType = typeof(FinishView) }, }); }