Beispiel #1
0
        private void CommitTextBoxWithFocus()
        {
            if (_textboxWithFocus == null)
            {
                return;
            }

            System.Windows.Data.BindingExpression expression =
                _textboxWithFocus.GetBindingExpression(TextBox.TextProperty);
            if (expression != null)
            {
                expression.UpdateSource();
            }
        }
Beispiel #2
0
        protected override void OnTextChanged(TextChangedEventArgs e)
        {
            // if the timer elapsed or text was changed by something besides a keystroke
            // fire base.OnTextChanged
            if (TimerElapsed || !KeysPressed)
            {
                TimerElapsed = false;
                KeysPressed  = false;
                base.OnTextChanged(e);

                System.Windows.Data.BindingExpression be = GetBindingExpression(TextProperty);
                if (be != null && be.Status == System.Windows.Data.BindingStatus.Active)
                {
                    be.UpdateSource();
                }

                PreviousTextValue = Text;
            }

            _previousTextChangedEventArgs = e;
        }