Mvvm Pattern erweitert

This commit is contained in:
Husky
2020-02-21 08:50:00 +01:00
parent 183646b4da
commit 5798fc6108
7 changed files with 51 additions and 52 deletions

View File

@@ -3,6 +3,7 @@ using KanSan.Base.Models;
using KanSan.ViewModel;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows;
using System.Windows.Controls;
@@ -21,24 +22,20 @@ namespace KanSan.UI
/// </summary>
public partial class UCKundeEdit : UserControl
{
private Kunde kunde = null;
private UnitOfWork unitOfWork = null;
public UCKundeEdit(Kunde kunde)
//private Kunde kunde = null;
//private UnitOfWork unitOfWork = null;
public UCKundeEdit()
{
InitializeComponent();
this.kunde = kunde;
unitOfWork = new UnitOfWork(new KanSanContext());
KundeViewModel kundeViewModel = new KundeViewModel(kunde);
kundeViewModel.PropertyChanged += KundeViewModel_PropertyChanged;
this.DataContext = kundeViewModel;
this.DataContext = new KundeViewModel();
}
private void KundeViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
private void Speichern_Click(object sender, RoutedEventArgs e)
{
throw new NotImplementedException();
((KundeViewModel)DataContext).Speichern();
}
}
}