コード例 #1
0
        private bool ValidateEntries()
        {
            bool isValidUser            = Email.Validate();
            bool isValidFullName        = FullName.Validate();
            bool isValidBirthDate       = BirthDate.Validate();
            bool isValidPhoneNumber     = PhoneNumber.Validate();
            bool isValidPassword        = Password.Validate();
            bool isValidConfirmPassword = ConfirmPassword.Validate();

            return(isValidUser && isValidFullName && isValidBirthDate &&
                   isValidPhoneNumber && isValidPassword && isValidConfirmPassword);
        }
コード例 #2
0
        private void OnCreateAccauntCommand()
        {
            System.Diagnostics.Debug.WriteLine("Create accaunt");

            if (!Email.Validate() || !Password.Validate() || !ConfirmPassword.Validate())
            {
                var errorMessage = string.Empty;
                if (Email.ErrorsMessages.Any())
                {
                    errorMessage = Email.ErrorsMessages.First();
                }
                else if (Password.ErrorsMessages.Any())
                {
                    errorMessage = Password.ErrorsMessages.First();
                }
                else
                {
                    errorMessage = ConfirmPassword.ErrorsMessages.First();
                }
                Application.Current.MainPage.DisplayAlert("ERROR", errorMessage, "OK");
            }
        }