private void ShowAddGerecht() { SelectedGerecht = new GerechtVM(); RaisePropertyChanged("SelectedGerecht"); addGerechtWindow = new AddGerecht(); addGerechtWindow.Show(); }
public MainViewModel() { ShowAddGerechtCommand = new RelayCommand(ShowAddGerecht); SaveGerechtCommand = new RelayCommand(SaveGerecht); SelectedGerecht = new GerechtVM(); context = new MyContext(); //1. ophalen gerechten IEnumerable<GerechtVM> gerechten = context.Gerechten .ToList().Select(g => new GerechtVM(g)); Gerechten = new ObservableCollection<GerechtVM>(gerechten); }
public MainViewModel() { ShowAddGerechtCommand = new RelayCommand(ShowAddGerecht); SaveGerechtCommand = new RelayCommand(SaveGerecht); SelectedGerecht = new GerechtVM(); context = new MyContext(); //1. ophalen gerechten IEnumerable <GerechtVM> gerechten = context.Gerechten .ToList().Select(g => new GerechtVM(g)); Gerechten = new ObservableCollection <GerechtVM>(gerechten); }