/// <summary> /// Provides handling for the LostFocus event. /// </summary> /// <param name="e">Event arguments.</param> protected override void OnLostFocus(RoutedEventArgs e) { if (Interaction.AllowLostFocus(e)) { Interaction.OnLostFocusBase(); base.OnLostFocus(e); } }
protected override void OnLostFocus(RoutedEventArgs e) { if (Interaction.AllowLostFocus(e)) { Interaction.OnLostFocusBase(); } // we're not calling base on purpose // SL2 does not fire the GotFocus event on Thumbs }
/// <summary> /// Provides handling for the LostFocus event. /// </summary> /// <param name="e">The data for the event.</param> protected override void OnLostFocus(RoutedEventArgs e) { if (Interaction.AllowLostFocus(e)) { if (!IsInvalidInput) { IsEditing = false; } else { if (InvalidInputAction == InvalidInputAction.TextBoxCannotLoseFocus && FocusManager.GetFocusedElement() != Text) { // the control lost focus while we have invalid input, which is not accepted Dispatcher.BeginInvoke(() => Text.Focus()); } } Interaction.OnLostFocusBase(); base.OnLostFocus(e); } }