Beispiel #1
0
        async void ExecuteSaveUser()
        {
            userDatabase = new UserDatabase();

            if (UserInformation.Password != UserInformation.ConfirmPassword)
            {
                try
                {
                    await _pageDialog.DisplayAlertAsync("Hey There", "Passwords dont match", "Okay");
                }
                catch (Exception ex)
                {
                    await _pageDialog.DisplayAlertAsync($"Hey {UserInformation.Name}", ex.Message, "Ok");
                }

                UserInformation = new UserInformation();
            }
            else
            {
                var navParameters = new NavigationParameters();
                navParameters.Add("user", UserInformation);
                await userDatabase.SaveUser(UserInformation);

                await _pageDialog.DisplayAlertAsync($"Hey {UserInformation.Name}", "You have successfully signed up", "Ok");

                await NavigationService.NavigateAsync("LoginPage", navParameters);
            }
        }