Example #1
0
        private async void Register()
        {
            TriviaWebAPIProxy proxy = TriviaWebAPIProxy.CreateProxy();
            User user = new User()
            {
                Email    = Email,
                NickName = Nickname,
                Password = Password
            };
            Task <bool> registerTask = Task.Run(() => proxy.RegisterUser(user));
            await       registerTask;

            if (registerTask.Result)
            {
                ((App)App.Current).User = user;
                if (!popOrPush)
                {
                    PushModal?.Invoke(new QuestioningPage());
                }
                else
                {
                    Pop?.Invoke();
                }
            }
            else
            {
                Error = "Email or NickName Exists";
            }
        }
Example #2
0
        private async void Login()
        {
            TriviaWebAPIProxy proxy     = TriviaWebAPIProxy.CreateProxy();
            Task <User>       loginTask = proxy.LoginAsync(Email, Password);
            await             loginTask;

            if (loginTask.Result != null)
            {
                ((App)App.Current).User = loginTask.Result;
                PushModal?.Invoke(new QuestioningPage());
            }
            else
            {
                Error = "Email or NickName Does Not Match";
            }
        }
Example #3
0
 private void ContinueAsGuest()
 {
     PushModal?.Invoke(new QuestioningPage());
 }