예제 #1
0
        private void ClearFields(Pwds p)
        {
            NewUser.Username = string.Empty;
            NewUser.Email    = string.Empty;
            NewUser.CanUserChangePassword = false;
            NewUser.Roles.Clear();
            p.Pb1.Password = string.Empty;
            p.Pb2.Password = string.Empty;

            AllRolesFiltered.ReplaceWith(AllRoles.Select(x => x.Name).ToList());
        }
예제 #2
0
        public AddNewUserViewModel() : base()
        {
            StartCreateNewCommand   = new RelayCommand(pswd => CreateNew((Pwds)pswd), x => IsCreationAllowed(x));
            AddRoleCommand          = new RelayCommand(role => AddRole(role as String), x => IsCreationAllowed(x));
            RemoveRoleCommand       = new RelayCommand(role => RemoveRole(role as String), x => IsCreationAllowed(x));
            AddRolesCommand         = new RelayCommand(role => AddRoles(role), x => IsCreationAllowed(x));
            RemoveRolesCommand      = new RelayCommand(role => RemoveRoles(role), x => IsCreationAllowed(x));
            AddMultipleRolesCommand = new RelayCommand(group => AddMultipleRoles(group as string), x => IsCreationAllowed(x));

            NewUser = new UserData()
            {
                Email = string.Empty
            };
            AllRolesFiltered = new ObservableCollection <string>(AllRoles?.Select(x => x.Name)?.ToList());

            NewUser.PropertyChanged += NewUser_PropertyChanged;
        }