public SignInViewModel(IMvxNavigationService navigationService,
                               IUserAccountService userAccountService,
                               IDialogueService dialogueService)
        {
            _navigationService  = navigationService;
            _userAccountService = userAccountService;
            _dialogueService    = dialogueService;

            this.SignInCommand = ReactiveCommand.CreateFromTask(async() =>
            {
                var result = await _userAccountService.AuthenticateUser(UserName, Password);

                if (result)
                {
                    _dialogueService.ShowInformation("Great Success!!");
                }
            },
                                                                this.WhenAnyValue(
                                                                    x => x.UserName, x => x.Password,
                                                                    (userName, password) =>
                                                                    !string.IsNullOrEmpty(userName) &&
                                                                    !string.IsNullOrEmpty(password)));

            this.CreateAccountCommand = ReactiveCommand.CreateFromTask(() =>
            {
                return(_navigationService.Navigate <NewAccountViewModel>());
            });
        }
Esempio n. 2
0
 public Guid AuthenticateUser(UserLoginDTO loginDto)
 {
     return(_userAccountService.AuthenticateUser(loginDto));
 }