Exemple #1
0
        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();
            }
        }
Exemple #2
0
        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();
        }