Ejemplo n.º 1
0
        private bool IsValid()
        {
            TbUsername.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            PbPassword.GetBindingExpression(PasswordHelper.PasswordProperty).UpdateSource();

            return(!Validation.GetHasError(TbUsername) && !Validation.GetHasError(PbPassword));
        }
Ejemplo n.º 2
0
        private bool IsValid(bool isEdit)
        {
            if (!isEdit)
            {
                TbUsername.GetBindingExpression(TextBox.TextProperty).UpdateSource();
                PbPassword.GetBindingExpression(PasswordHelper.PasswordProperty).UpdateSource();
            }
            CbGender.GetBindingExpression(ComboBox.SelectedValueProperty).UpdateSource();
            DpBirthDate.GetBindingExpression(DatePicker.SelectedDateProperty).UpdateSource();
            TbName.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            TbEmail.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            TbPhoneNumber.GetBindingExpression(TextBox.TextProperty).UpdateSource();
            TbAddress.GetBindingExpression(TextBox.TextProperty).UpdateSource();

            return(!Validation.GetHasError(CbGender) && !Validation.GetHasError(DpBirthDate) && !Validation.GetHasError(TbName) &&
                   !Validation.GetHasError(TbEmail) && !Validation.GetHasError(TbPhoneNumber) && !Validation.GetHasError(TbAddress) &&
                   (!isEdit || (!Validation.GetHasError(TbUsername) && !Validation.GetHasError(PbPassword))));
        }