Ejemplo n.º 1
0
        /// <summary>
        /// Adds new data to the grid list
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Butadd_Click(object sender, RoutedEventArgs e)
        {
            NeueLuftfahrzeug n = new NeueLuftfahrzeug();

            n.Owner = this;
            n.ShowDialog();

            if (n.noexception == true)
            {
                Luftfahrzeuge.Add(n.luftzeug);
            }

            DataContext = null;
            DataContext = this;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Changes data already stored in the grid list
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Butchange_Click(object sender, RoutedEventArgs e)
        {
            Luftfahrzeug     luftfahrzeug = FahrzeugGrid.SelectedItem as Luftfahrzeug;
            NeueLuftfahrzeug w            = new NeueLuftfahrzeug(luftfahrzeug);

            w.Owner = this;
            w.ShowDialog();
            if (w.noexception == true)
            {
                Luftfahrzeuge.Remove(luftfahrzeug);
                Luftfahrzeuge.Add(w.luftzeug);
            }
            DataContext = null;
            DataContext = this;
        }