public AddMultipleUserManagerUsersViewModel(IUserManagerClient userManagerClient, IEventAggregator eventAggregator) { Height = 560; CurrentViewIndex = 0; UsernameAndPasswordViewModel = new AddMultipleUsersUsernameAndPasswordViewModel(); ProfileAndOwnerViewModel = new AddMultipleUserManagerUsersProfileAndOwnerViewModel(userManagerClient); ((DelegateCommand)UsernameAndPasswordViewModel.NextCommand).RaiseCanExecuteChanged(); #region Init Cmmands // Init the next command of the first view UsernameAndPasswordViewModel.NextCommand = new DelegateCommand(() => { Height = 400; CurrentViewIndex = 1; }, () => UsernameAndPasswordViewModel.CanNavigate); // init the finish command of the second view ProfileAndOwnerViewModel.FinishCommand = new DelegateCommand(() => { eventAggregator.GetEvent <AddMultipleUserManagerUsersEvent>().Publish(this); DialogHost.CloseDialogCommand.Execute(null, null); }, () => ProfileAndOwnerViewModel.SelectedCustomerIndex > -1 && (!ProfileAndOwnerViewModel.ActivateUserNow || ProfileAndOwnerViewModel.SelectedProfileIndex > -1)); #endregion }
public AddMultipleUserManagerUsersProfileAndOwnerViewModel(IUserManagerClient userManagerClient) : base(userManagerClient) { RefreshCustomersCommand = new DelegateCommand(async() => { Customers = new ObservableCollection <string>((await userManagerClient.LoadAllCustomersAsync()).Select(c => c.Login)); if (Customers.Count > 0) { SelectedCustomerIndex = 0; } }); RefreshCustomersCommand.Execute(null); }
public AddUserManagerUserBasicViewModel(IUserManagerClient userManagerClient) { // Init Next Command NextCommand = new DelegateCommand(() => Transitioner.MoveNextCommand.Execute(null, null), () => !string.IsNullOrEmpty(Username) && SelectedCustomerIndex > -1).ObservesProperty( () => SelectedCustomerIndex).ObservesProperty(() => Username); // Init Refresh Customers command RefreshCustomersCommand = new DelegateCommand( async() => Customers = new ObservableCollection <string>( (await userManagerClient.LoadAllCustomersAsync()).Select(c => c.Login))); }
/// <summary> /// Default construtor /// </summary> public AddUserManagerUserViewModel(IUserManagerClient userManagerClient, IEventAggregator eventAggregator) { BasicViewModel = new AddUserManagerUserBasicViewModel(userManagerClient); ProfileViewModel = new AddUserManagerUserProfileViewModel(userManagerClient); #region Init Commands ProfileViewModel.FinishCommand = new DelegateCommand(() => { eventAggregator.GetEvent <AddUserManagerUserEvent>().Publish(this); DialogHost.CloseDialogCommand.Execute(null, null); }, () => !ProfileViewModel.ActivateUserNow || ProfileViewModel.SelectedProfileIndex > -1); #endregion BasicViewModel.RefreshCustomersCommand.Execute(null); }
/// <summary> /// Default constructor /// </summary> public UserManagerUsersViewModel(IUserManagerClient userManagerClient, IEventAggregator eventAggregator, IDialogService dialogService) { _userManagerClient = userManagerClient; _eventAggregator = eventAggregator; _dialogService = dialogService; // Init public properties Users = new ObservableCollection <UserManagerUserViewModel>(); // Init Commands InitCommands(); // Subscribe events SubscribeEvents(); // Refresh the users list RefreshCommand.Execute(null); }
public POWRSharePaymentScheme(IConnectionFactory cf, IShareRepository shareRepo, IBlockRepository blockRepo, IBalanceRepository balanceRepo, IUserManagerClient userManagerClient, ClusterConfig clusterConfig) { Contract.RequiresNonNull(cf, nameof(cf)); Contract.RequiresNonNull(shareRepo, nameof(shareRepo)); Contract.RequiresNonNull(blockRepo, nameof(blockRepo)); Contract.RequiresNonNull(balanceRepo, nameof(balanceRepo)); this.cf = cf; this.shareRepo = shareRepo; this.blockRepo = blockRepo; this.balanceRepo = balanceRepo; this.config = clusterConfig; this.userManagerClient = userManagerClient; BuildFaultHandlingPolicy(); }