public SettingsWindow(SettingsViewModel vm) { InitializeComponent(); VM = vm; this.DataContext = VM; VM.CloseEvent += VM_CloseEvent; }
/// <summary> /// Launches a modal dialog to allow user to change settings /// </summary> private void LaunchSettingsWindow() { var vm = new SettingsViewModel(); var window = new SettingsWindow(vm); window.Owner = Application.Current.MainWindow; window.ShowDialog(); }