private void ExitButton_Click(object sender, RoutedEventArgs e) { this.IsEnabled = false; ExitConfirmation exitConfirmation = new ExitConfirmation(); exitConfirmation.OwningWindow = this; exitConfirmation.Show(); //exitConfirmation.Left = this.Left + (this.Width - exitConfirmation.ActualWidth) / 2; //exitConfirmation.Top = this.Top + (this.Height - exitConfirmation.ActualHeight) / 2; }
private void ExitButton_Click(object sender, RoutedEventArgs e) { this.IsEnabled = false; ExitConfirmation exitConfirmation = new ExitConfirmation(); exitConfirmation.OwningWindow = this; exitConfirmation.Show(); this.MouseDown -= Window_MouseDown; exitConfirmation.Left = origin.X + (size.Width - exitConfirmation.ActualWidth) / 2; exitConfirmation.Top = origin.Y + (size.Height - exitConfirmation.ActualHeight) / 2; }