private void BtnDeleteMaterial_Click(object sender, RoutedEventArgs e) { ConfirmationWindow confirmationWindow = new ConfirmationWindow("Er du sikker på du vil SLETTE materialet?"); confirmationWindow.Owner = this; confirmationWindow.Top = this.Top; confirmationWindow.Left = this.Left + 8; confirmationWindow.ShowDialog(); if ((bool)confirmationWindow.DialogResult) { RemoveMaterial(); } }
private void MaterialWindow_OnClosing(object sender, CancelEventArgs e) { if (!removeMaterial) { ConfirmationWindow confirmationWindow = new ConfirmationWindow("Vil du gemme ændringerne?"); confirmationWindow.Owner = this; confirmationWindow.Top = this.Top; confirmationWindow.Left = this.Left + 8; confirmationWindow.ShowDialog(); if ((bool)confirmationWindow.DialogResult) { SaveMaterial(); } } Notify(); }