protected void OnDeleteEvent(object sender, DeleteEventArgs a) { if (!_myVM.CloseCommand()) { return; } Application.Quit(); a.RetVal = true; }
protected override void OnClosing(System.ComponentModel.CancelEventArgs e) { if (!_myVM.CloseCommand()) { e.Cancel = true; return; } Properties.Settings.Default.LastWidth = (int)this.Width; Properties.Settings.Default.LastHeight = (int)this.Height; Properties.Settings.Default.LastLeft = (int)this.Left; Properties.Settings.Default.LastTop = (int)this.Top; Properties.Settings.Default.Save(); base.OnClosing(e); }