Exemple #1
0
        private void ValdiateTextBoxNotTip(AyTextBox _d)
        {
            if (IsTextMustInDropDown)
            {
                if (!_d.Text.IsNullOrWhiteSpace() && this.SelectedItem.IsNull())
                {
                    this.ErrorInfo = AyFormErrorTemplate.ComboBoxInvalidItem;
                    _d.IsError     = true;
                    return;
                }
            }

            if (IsFirstItemInvalid && this.SelectedIndex <= 0)
            {
                ErrorInfo  = AyFormErrorTemplate.Required;
                _d.IsError = true;
                return;
            }


            var _r = _d.Text.ToAyExpressionFormResult(this.Rule);

            if (_r.Result)
            {
                _d.IsError = false;
                ErrorInfo  = string.Empty;
            }
            else
            {
                ErrorInfo  = _r.Error;
                _d.IsError = true;
            }
        }
Exemple #2
0
        private void BeginTextBoxValidate(object sender)
        {
            AyTextBox _d = sender as AyTextBox;

            if (_d != null)
            {
                ValdiateTextBox(_d);
            }
        }
Exemple #3
0
        public override void OnApplyTemplate()
        {
            targetTextBox = Template.FindName("PART_ROOT", this) as Border;
            //if (popup != null)
            //{
            //    popup.Opened += popup_Opened;
            //}

            editBox   = Template.FindName("PART_EditableTextBox", this) as AyTextBox;
            searchBox = Template.FindName("PART_SearchTextBox", this) as AyTextBox;

            if (AfterSelectBehavior == ComboAfterSelectBehavior.UnSelectAll)
            {
                this.SelectionChanged += AyComboBox_SelectionChanged;
                //this.DropDownClosed += AyComboBox_DropDownClosed;
            }
            base.OnApplyTemplate();
        }