public SettingEditorWindowViewModelBase(T setting) { Setting = setting.DeepClone(); Setting.Clean(); Setting = setting; CancelCommand = new DelegateCommand <Window>((w) => { IsCancelled = true; w.Close(); }); DoneCommand = new DelegateCommand <Window>((w) => { string error = string.Empty; if (ValidateSettingCallback != null && !ValidateSettingCallback(Setting, ref error)) { MessageBox.Show(error); return; } IsCancelled = false; w.Close(); }); }