#654 – Mouse Events for Button Presses

When a user clicks on a mouse button, there are a series of preview events (tunneling) and actual events (bubbling) that travel up and down the logical tree.

For example, for a Label contained in a StackPanel, which is contained in a Window, the full sequence of events for a left mouse button click on the Label is:

  • PreviewMouseLeftButtonDown for Window
  • PreviewMouseDown for Window
  • PreviewMouseLeftButtonDown for StackPanel
  • PreviewMouseDown for StackPanel
  • PreviewMouseLeftButtonDown for Label
  • PreviewMouseDown for Label
  • MouseLeftButtonDown for Label
  • MouseDown for Label
  • MouseLeftButtonDown for StackPanel
  • MouseDown for StackPanel
  • MouseLeftButtonDown for Window
  • MouseDown for Window
  • PreviewMouseLeftButtonUp for Window
  • PreviewMouseUp for Window
  • PreviewMouseLeftButtonUp for StackPanel
  • PreviewMouseUp for StackPanel
  • PreviewMouseLeftButtonUp for Label
  • PreviewMouseUp for Label
  • MouseLeftButtonUp for Label
  • MouseUp for Label
  • MouseLeftButtonUp for Stackpanel
  • MouseUp for StackPanel
  • MouseLeftButtonUp for Window
  • MouseUp for Window

 

Advertisements