public RouteVM() { //lister lists = new Listerne(); _hour = hour; _minute = minute; x = Singleton.Instance; _datoValgt = datoValgt; _date = date; //page p = new PageCommand(); // route _loadRoute = new RelayCommand(LoadRoute); _ruteToBeCreated = new Route(); _ruter = new ObservableCollection <Route>(); _createOneRute = new RelayCommand(OpretRute1); _selectedRute = new Route(); _updateOneRute = new RelayCommand(UpdateRute); _deleteOneRute = new RelayCommand(DeleteRute); _clearCreateOneRute = new RelayCommand(ClearCreateRute); _persistenceRoute = new DBPersistenceRute(); _handleR = new RelayCommand(HandleSelectedItem); // car _cvm = new CarVM(); _persistenceCar = new DBPersistenceCar(); _loadIdCar = new RelayCommand(LoadIdCars); _selectedCar = new Car(); //user _uvm = new UserVM(); //passenger _createOnePassenger = new RelayCommand(OpretPassenger); _passengerToBeCreated = new Passenger(); _persistencePassenger = new DBPersistencePassenger(); //load LoadRoute(); }
//Constructor #region Constructor public PassengerVM() { //view models _uvm = new UserVM(); _rvm = new RouteVM(); _cvm = new CarVM(); p = new PageCommand(); //_fvm = new ForumVM(); //_svm = new SprogVM(); //_mvm = new MainVM(); //persistens _persistenceCar = new DBPersistenceCar(); _persistensUser = new DBPersistence(); _persistencePassenger = new DBPersistencePassenger(); _persistensRoute = new DBPersistenceRute(); // passenger _loadPassenger = new RelayCommand(LoadPassengers); _passengerToBeCreated = new Passenger(); _passengers = new ObservableCollection <Passenger>(); //_createOnePassenger = new RelayCommand(OpretPassenger); _selectedPassenger = new Passenger(); _updateOnePassengerAcc = new RelayCommand(UpdatePassengerAccept); _updateOnePassengerDec = new RelayCommand(UpdatePassengerDecline); _updateOnePassengerCheckInd = new RelayCommand(UpdateCheckInd); _deleteOnePassenger = new RelayCommand(DeletePassenger); _clearCreateOnePassenger = new RelayCommand(ClearCreatePassenger); _loadCurrentPassenger = new RelayCommand(LoadCurrentPassenger); _loadTilmeldteRuter = new RelayCommand(LoadTilmeldte); //load LoadTilmeldte(); LoadCurrentPassenger(); }