public void SetWizard(WizardModel wizard) { Guard.ArgumentNotNull(wizard, "wizard"); if (this.wizardModel != null) { this.wizardModel.OnCloseAction = null; } this.wizardModel = wizard; this.DataContext = wizardModel; wizard.OnCloseAction = () => this.Close(); }