/// <summary> /// コンストラクタ /// </summary> /// <param name="service"></param> /// <param name="pageDialogService"></param> /// <param name="navigationService"></param> public LoginPageViewModel(ILoginPageService service, IPageDialogService pageDialogService, INavigationService navigationService) { _service = service; _pageDialogService = pageDialogService; _navigationService = navigationService; // バリデーションチェック有効化 NewEmail = new ReactiveProperty <string>().SetValidateAttribute(() => NewEmail); UserCategory = new ReactiveProperty <CommonEnums.UserCategoryType>().SetValidateAttribute(() => UserCategory); Email = new ReactiveProperty <string>().SetValidateAttribute(() => Email); Password = new ReactiveProperty <string>().SetValidateAttribute(() => Password); // ボタンの監視登録 SelectedRollACommand.Subscribe(_ => { UserCategory.Value = CommonEnums.UserCategoryType.UserRollA; }); SelectedRollBCommand.Subscribe(_ => { UserCategory.Value = CommonEnums.UserCategoryType.UserRollB; }); CreateUserCommand.Subscribe(_ => { // 新規登録 var result = _service.CreateUser(NewEmail, UserCategory); AfterProcForCreateUser(result.serviceResult, result.id); }); LoginCommand.Subscribe(_ => { // ログイン var result = _service.Login(Email, Password); AfterProcForLogin(result); }); // 初期処理 InitializeLoginPage(); }
public LoginViewModel(ILoginPageService page) { Lozinka = new ValidatableObject <string>(); KorisnickoIme = new ValidatableObject <string>(); pageService = page; UneseniIspravniPodaci = false; DohvatiInstanceAsync = new AsyncCommand(DohvatiKorisnickeInstance, Moze); }
public StudentFacade(ILoginPageService loginService, ISchedulerPageService schedulerService) { _loginService = loginService; _schedulerService = schedulerService; }