public UserControl Initialize(ActionBarView actionBar, string databaseName) { mDatabaseName = databaseName; UserControl view = new ArtikelverwaltungView(); mArticleRepository = new Repository<Article>( databaseName); mViewModel = new ArtikelverwaltungViewModel() { Articles = new ObservableCollection<Article>(mArticleRepository.GetAll()), SelectedArticle = null }; view.DataContext = mViewModel; actionBar.DataContext = new ActionBarViewModel { Command1 = new RelayCommand(AddCommandExecute), Command2 = new RelayCommand(DeleteCommandExecute, DeleteCommandCanExecute), Command3 = new RelayCommand(SaveCommandExecute, SaveCommandCanExecute), Command4 = new RelayCommand(ImportCommandExecute), Command1Text = "Neu", Command2Text = "Löschen", Command3Text = "Speichern", Command4Text = "Importieren" }; return view; }
//private Repository<Address> mAddressRepository; public UserControl Initialize(ActionBarView actionBar, string databaseName) { mDatabaseName = databaseName; UserControl view = new KundenverwaltungView(); mCustomerRepository = new Repository<Customer>( mDatabaseName); mViewModel = new KundenverwaltungViewModel { Models = new ObservableCollection<Customer>(mCustomerRepository.GetAll()), SelectedModel = null }; view.DataContext = mViewModel; mActionBarViewModel = new ActionBarViewModel { Command1 = new RelayCommand(AddCommandExecute), Command2 = new RelayCommand(DeleteCommandExecute, DeleteCommandCanExecute), Command3 = new RelayCommand(SaveCommandExecute, SaveCommandCanExecute), Command1Text = "Neu", Command2Text = "Löschen", Command3Text = "Speichern" }; actionBar.DataContext = mActionBarViewModel; return view; }
public UserControl Initialize(ActionBarView actionBar, string databaseName) { mDatabaseName = databaseName; UserControl view = new MitarbeiterverwaltungView(); mEmployeeRepository = new Repository<Employee>( mDatabaseName); //TODO: hier den absoluten Verweis ersetzen //mAddressRepository = new Repository<Address>(databaseName); mViewModel = new MitarbeiterverwaltungViewModel { Models = new ObservableCollection<Employee>(mEmployeeRepository.GetAll()), SelectedModel = null }; view.DataContext = mViewModel; mActionBarViewModel = new ActionBarViewModel { Command1 = new RelayCommand(AddCommandExecute), Command2 = new RelayCommand(DeleteCommandExecute, DeleteCommandCanExecute), Command3 = new RelayCommand(SaveCommandExecute, SaveCommandCanExecute), Command1Text = "Neu", Command2Text = "Löschen", Command3Text = "Speichern" }; actionBar.DataContext = mActionBarViewModel; return view; }
public ActionBarView Initialize() { ActionBarView ActionBarView = new ActionBarView(); ActionBarView.DataContext = new ActionBarViewModel { //Es wird eine Aktionslose ActionBar Initialisiert... }; return ActionBarView; }
public UserControl Initialize(ActionBarView actionBar, string databasename) { var ret = new ReportingView(); mDatabaseName = databasename; mViewModel = new ReportingViewModel { ZeigeMitarbeiterReporting = new RelayCommand(ZeigeMitarbeiterReportingExecute), ZeigeArtikelReporting = new RelayCommand(ZeigeArtikelReportingExecute), AktualisiereReporting = new RelayCommand(AktualisiereReportingExecute) }; actionBar.DataContext = new ActionBarViewModel(); ret.DataContext = mViewModel; return ret; }
public void Initialize(string databaseName) { mDatabaseName = databaseName; mActionBar = new ActionBarController().Initialize(); mView = new MainWindowView(); //mMitarbeiterverwaltung = new ReportingController().Initialize(getActionBar(),mDatabaseName);//new MitarbeiterverwaltungController().Initialize(mActionBar, databaseName);// mViewModel = new MainWindowViewModel { Content = null, ActionBar = mActionBar, ZeigeMitarbeiterverwaltung = new RelayCommand(ZeigeMitarbeiterverwaltungExecute), ZeigeReporting = new RelayCommand(ZeigeReportingExecute), ZeigeArtikelverwaltung = new RelayCommand(ZeigeArtikelverwaltungExecute), ZeigeAuftragsverwaltung = new RelayCommand(ZeigeAuftragsverwaltungExecute), ZeigeKundenverwaltung = new RelayCommand(ZeigeKundenverwaltungExecute) }; mView.DataContext = mViewModel; mView.ShowDialog(); }
public UserControl Initialize(ActionBarView actionBar, string databaseName) { mDatabaseName = databaseName; UserControl ret = new AuftragsverwaltungView(); var orderEdit = new OrderEditControl(); mViewModel = new AuftragsverwaltungViewModel { Employees = new CollectionView(new Repository<Employee>(mDatabaseName).GetAll()), Customers = new CollectionView(new Repository<Customer>(mDatabaseName).GetAll()), Articles = new CollectionView(new Repository<Article>(mDatabaseName).GetAll()) }; mViewModel.EditControl = orderEdit.Initialize(new ActionBarView(), mDatabaseName, mViewModel) as UserControl; actionBar.DataContext = new ActionBarViewModel { Command1Text = "Neuer Auftrag", Command1 = new RelayCommand(AddOrderExecute), Command2Text = "Neue Auftragsposition", Command2 = new RelayCommand(AddPositionExecute), Command3Text = "Änderungen Speichern", Command3 = new RelayCommand(SaveCommandExecute), Command5Text = "Position löschen", Command5 = new RelayCommand(DeletePositionExecute), Command4Text = "Auftrag löschen", Command4 = new RelayCommand(DeleteOrderExecute) }; AktualisiereAnzeige(); ret.DataContext = mViewModel; return ret; }