예제 #1
0
 /// <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);
     }
 }
예제 #2
0
 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
 }
예제 #3
0
        /// <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);
            }
        }