Example #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();
            switch (this.ValidateTrigger)
            {
            case EnumValidateTrigger.PropertyChanged:
                this.TextChanged += NumbericTextBox_TextChanged;
                this.LostFocus   -= NumbericTextBox_LostFocus;
                break;

            case EnumValidateTrigger.LostFocus:
                this.TextChanged -= NumbericTextBox_TextChanged;
                this.LostFocus   += NumbericTextBox_LostFocus;
                break;
            }

            //this.PART_ErrorPath = this.GetTemplateChild("PART_ErrorPath") as UIElement;
            //if(this.PART_ErrorPath != null)
            //{
            //    this.PART_ErrorPath.MouseEnter += (o, e) =>
            //    {
            //        this.IsShowErrorTip = true;
            //    };
            //    this.PART_ErrorPath.MouseLeave += (o, e) =>
            //    {
            //        this.IsShowErrorTip = false;
            //    };
            //}

            NumbericTextBox.SetPatternAndTip(this.PatternType, this, true);
        }