private void datagrid_MouseDoubleClick_1(object sender, MouseButtonEventArgs e)
        {
            DataGrid dg = sender as DataGrid;

            if (dg == null)
            {
                return;
            }

            Tilgungszahlung tilgungsZ = (Tilgungszahlung)dg.SelectedItem;
            if (tilgungsZ == null)
            {
                return;
            }

            var viewModel = new NeueJaehrlicheTilgungViewModel(tilgungsZ);

            var window = new NeueJaehrlicheTilgungView();
            window.Owner = this;
            window.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;

            EventHandler handler = null;
            handler = delegate
            {
                viewModel.RequestClose -= handler;
                window.Close();
            };

            viewModel.RequestClose += handler;
            window.DataContext = viewModel;
            window.ShowDialog();
        }
        private void NeuTilgung()
        {
            Tilgungszahlung newTilgung = new Tilgungszahlung();
            var viewModel = new NeueJaehrlicheTilgungViewModel(newTilgung);

            var window = new NeueJaehrlicheTilgungView();
            window.Owner = App.window;
            window.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;

            EventHandler handler = null;
            handler = delegate
            {
                viewModel.RequestClose -= handler;
                window.Close();
            };

            viewModel.RequestClose += handler;
            window.DataContext = viewModel;
            window.ShowDialog();

            if (viewModel.DialogResult == true)
            {
                newTilgung.Betrag = viewModel.Betrag;
                newTilgung.Zeitpunkt = new LocalDateTime(viewModel.Jahr, viewModel.Monat, viewModel.Tag, 12, 0);

                if (viewModel.DialogResult == true)
                {
                    this.Kredit.Tilgungen.Add(newTilgung);
                }

            }
        }