コード例 #1
0
        public PasswordChangeViewModel(ICredentialService credentials, INavigationAdapter navigation, Logging logging)
        {
            this.credentials = credentials;
            this.navigation  = navigation;
            log = logging.GetLoggerFor <PasswordChangeViewModel>();

            ChangePasswordCommand = new Command(
                async() => await ChangePassword(),
                CanChangePassword);
        }
コード例 #2
0
        public AddUserViewModel(Logging logging, INavigationAdapter navigation, ICredentialService credential, IEnumerable <Duty> roles)
        {
            this.navigation = navigation;
            this.credential = credential;
            log             = logging.GetLoggerFor <AddUserViewModel>();

            Roles = new ObservableCollection <RoleSelectionViewModel>(
                roles.Select(r => new RoleSelectionViewModel(r.Name, r.DisplayName)));

            AddNewUserCommand = new Command(async() => await AddNewUser(), CanAddNewUser);
        }
コード例 #3
0
        public Navigation(INavigationAdapter navigationAdapter, IAuthentication authentication)
        {
            this.navigationAdapter = navigationAdapter;
            this.authentication    = authentication;

            onLoggedOut = async(sender, args) => await OnLoggedOut();

            needsPasswordChange = async(sender, args) => await NeedsPasswordChange();

            authentication.NeedsPasswordChange += needsPasswordChange;
            authentication.LoggedOut           += onLoggedOut;
        }
コード例 #4
0
        public LoginViewModel(IAuthentication authentication, Logging logging, INavigationAdapter navigation)
        {
            this.authentication = authentication;
            this.navigation     = navigation;
            log = logging.GetLoggerFor <LoginViewModel>();

            onLoggedIn = async(sender, args) => await OnLoggedIn();

            authentication.LoggedIn += onLoggedIn;

            LoginCommand = new Command(async() => await Login(), CanLogin);
        }