protected override void OnClosing(CancelEventArgs e) { var vm = new SaveOnQuitVM(); Window1 myWin = new Window1(vm); myWin.ShowDialog(); if (vm.Save) { appVM.saveAll(); } if (vm.Cancel) { e.Cancel = true; } base.OnClosing(e); }
public Window1(SaveOnQuitVM vm) { this.DataContext = vm; InitializeComponent(); }