public PatientSheetViewModel(Patient patientToDisplay, MainWindowViewModel mainView = null) { this._patientToDisplay = patientToDisplay; this._observations = patientToDisplay.Observations == null ? new ObservableCollection <Observation>() : new ObservableCollection <Observation>(patientToDisplay.Observations); this._mainView = mainView; base.DisplayName = $"Udokotela - {FirstName} {Name}"; this.BackCommand = new RelayCommand(param => DismissBack(), param => this._mainView != null && this._mainView.HasBackgroundContent()); this.OnRowDoubleClic = new RelayCommand(param => ShowObservation(param as Observation), param => true); this.AddObservationCommand = new RelayCommand(param => AddObservation(), param => MainWindowViewModel.CheckUserRole()); }
/// <summary> /// Constructeur du ViewModel de la page d'accueil. /// </summary> public HomeViewModel(MainWindowViewModel mainView) { base.DisplayName = "Udokotela - Accueil"; this._userService = new CSUser(); this._mainView = mainView; GetUsersInfo(); AddUserCommand = new RelayCommand(param => AddUser(), param => MainWindowViewModel.CheckUserRole()); AddPatientCommand = new RelayCommand(param => AddPatient(), param => MainWindowViewModel.CheckUserRole()); UserManagementCommand = new RelayCommand(param => UserManagement(), param => this._mainView.UserManagementCommand.CanExecute(param)); PatientManagementCommand = new RelayCommand(param => PatientManagement(), param => this._mainView.PatientManagementCommand.CanExecute(param)); LiveDataCommand = new RelayCommand(param => LiveData(), param => this._mainView.LiveDataCommand.CanExecute(param)); }