Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. /// <summary>
  2. /// This is the method that responds to the MouseLeftButtonDownEvent event.
  3. /// </summary>
  4. /// <param name="e"></param>
  5. protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
  6. {
  7. // We should process only the direct events in case TabItem is the selected one
  8. // otherwise we are getting this event when we click on TabItem content because it is in the logical subtree
  9. if (e.Source == this || !IsSelected)
  10. {
  11. if (SetFocus())
  12. e.Handled = true;
  13. }
  14. base.OnMouseLeftButtonDown(e);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement