public WizardControl() { InitializeComponent(); ViewModel = new WizardControlViewModel(); ViewModel.ChangeStepViewModel = (id, vm) => steps[id].ChangeStepViewModel(vm); DataContext = ViewModel; }
public WizardStepContainer(WizardControlViewModel parent, int step, UserControl nestedControl) { this.parent = parent; InitializeComponent(); ViewModel = new WizardStepContainerViewModel(parent, step, nestedControl.DataContext as IWizardStep); StepContainer.Children.Add(nestedControl); DataContext = ViewModel; }
public WizardStepContainerViewModel(WizardControlViewModel parent, int step, IWizardStep stepViewModel) { ParentWizard = parent; Step = step; this.stepViewModel = stepViewModel; parent.PropertyChanged += (o, e) => { if (e.PropertyName.Equals("CurrentStep")) { OnPropertyChanged("StepVisible"); } }; }