private void editCommandAction(object obj) { var vm = new ViewModels.AddComputerVM(ChangeStatus.Edit, Source, SourceView, SelectedItem); var form = new Forms.AddLaptopView(); form.DataContext = vm; form.ShowDialog(); }
//Command Methode private void addCommandAction(object obj) { var form = new Forms.AddLaptopView(); var vm = new ViewModels.AddComputerVM(ChangeStatus.New, Source, SourceView, SelectedItem) { WindowClose = form.Close }; form.DataContext = vm; form.ShowDialog(); }