//Constructor in order to search an adult public Search_ViewModel(SearchAdult_UserCntrl mySearchAdult_UserCntrlV, LogIn_AdministratorViewModel logIn_AdministratorViewModel) { search_CMD = new Search_Command(this); search_Update_CMD = new Search_Update_Command(this); search_M = new Search_Model(); adults = new List <Adult>(); SearchAdult_UserCntrlV = mySearchAdult_UserCntrlV; LogIn_AdministratorVM = logIn_AdministratorViewModel; }
// The function adds the required user control to the main window users public void Add_UC(String userCntrl) { System.Windows.Controls.UserControl uc = new System.Windows.Controls.UserControl(); switch (userCntrl) { case "SearchDeliverMan": uc = new SearchDeliverMan_UserCntrl(this.logIn_AdministratorViewModel); break; case "SearchAdult": uc = new SearchAdult_UserCntrl(this.logIn_AdministratorViewModel); break; case "AddAdult": uc = new AddAdult_userCntrl(this.logIn_AdministratorViewModel); break; case "AddDeliverMan": uc = new Add_DeliverMan_UserCntrl(this.logIn_AdministratorViewModel); break; case "AddDelivery": uc = new deliveryAreas_usctrl(this.logIn_AdministratorViewModel); break; case "TasksManager": uc = new DeliveriesTasksList_UserCntrl(this.logIn_AdministratorViewModel); break; case "TaskSchedule": uc = new PrintDeliveriesDetails(this.logIn_AdministratorViewModel); break; case "Graphs": uc = new Graphs_View(); break; default: break; } UC.Children.Clear(); UC.Children.Add(uc); }