/// <summary> /// Initializes a new instance of the <see cref="CreateUserViewModel"/> class. /// </summary> /// <param name="notificationService">The notification service.</param> /// <param name="userFactory">The user factory.</param> /// <param name="regionManager">The region manager.</param> /// <param name="roleFactory">The role factory.</param> public CreateUserViewModel(INotificationService notificationService, RegionManager regionManager, IModelFactory <IUserModel, UserDto> userFactory, IModelFactory <IRoleModel, RoleDto> roleFactory) { _notificationService = notificationService; _userFactory = userFactory; _roleFactory = roleFactory; _cancelCommand = new CellentCommand(ExecuteCancelUser); _okCommand = new CellentCommand(SaveUser, CanSaveUser); _journal = regionManager.Regions[Constants.Regions.MainRegion].NavigationService.Journal; }
/// <summary> /// Initializes a new instance of the <see cref="ResourceListViewModel" /> class. /// </summary> /// <param name="resourceFactory">The resource factory.</param> /// <param name="notificationService">The notification service.</param> /// <param name="regionManager">The region manager.</param> public ResourceListViewModel(IModelFactory <IResourceModel, ResourceDto> resourceFactory, INotificationService notificationService, IRegionManager regionManager) { _resourceFactory = resourceFactory; _notificationService = notificationService; _regionManager = regionManager; _addResourceCommand = new CellentCommand(ExecuteCreateResource, ClientRights.CanWriteRessource); _editResourceCommand = new CellentCommand <object>(ExecuteEditResource, ClientRights.CanWriteRessource); _doubleClickOnResourceCommand = new CellentCommand(ExecuteDoubleClickOnResourceCommand, ClientRights.CanWriteRessource); _deleteResourceCommand = new CellentCommand <object>(ExecuteDeleteResource, ClientRights.CanWriteRessource); _refreshListCommand = new CellentCommand(LoadData); }
/// <summary> /// Initializes a new instance of the <see cref="UserListViewModel" /> class. /// </summary> /// <param name="notificationService">The notification service.</param> /// <param name="regionManager">The region manager.</param> /// <param name="userFactory">The user mapper.</param> public UserListViewModel(INotificationService notificationService, IRegionManager regionManager, IModelFactory <IUserModel, UserDto> userFactory) { _notificationService = notificationService; _regionManager = regionManager; _userFactory = userFactory; _doubleClikOnUserCommand = new CellentCommand(ExecuteEditUser); _editUserCommand = new CellentCommand(ExecuteEditUser, CanExecuteEditUser); _addUserCommand = new CellentCommand(ExecuteAddUser, ClientRights.CanWriteUser); _refreshListCommand = new CellentCommand(LoadData); _editUserCommandParameter = new CellentCommand <object>(p => ExecuteEditUser(p)); _addUserInteractionRequest = new InteractionRequest <UserDialogNotification>(); }