Ejemplo n.º 1
0
 private void HandleButtonDown()
 {
     if (!(User32.GetFocus() != IntPtr.Zero) ||
         CommandFocusManager.IsInsideCommandContainer(Mouse.DirectlyOver) ||
         !CommandFocusManager.IsInsideCommandContainer(Keyboard.FocusedElement))
     {
         return;
     }
     Keyboard.Focus(null);
 }
Ejemplo n.º 2
0
 private IntPtr HandleMouseActivate(ref bool handled)
 {
     if (User32.GetFocus() != IntPtr.Zero)
     {
         if (CommandFocusManager.IsInsideCommandContainer(Mouse.DirectlyOver))
         {
             handled = true;
             return(new IntPtr(3));
         }
         if (CommandFocusManager.IsInsideCommandContainer(Keyboard.FocusedElement))
         {
             Keyboard.Focus(null);
         }
     }
     return(IntPtr.Zero);
 }