private void CommitTextBoxWithFocus() { if (_textboxWithFocus == null) { return; } System.Windows.Data.BindingExpression expression = _textboxWithFocus.GetBindingExpression(TextBox.TextProperty); if (expression != null) { expression.UpdateSource(); } }
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; }