Reputation: 695
I have about 3000 checkboxes that I would like to have their "PreviewMouseLeftButtonDown" event handled differently. Is it possible to override the default event handler for all checkboxes globally?
Upvotes: 1
Views: 778
Reputation: 564413
Checkbox.Checked
is a Routed Event. This means you can assign a common event handler within a parent of the tree, and handle the events "globally" however you choose.
For details, see Routed Events Overview, in particular, the section titled "Singular Handler Attachment Points", which deals with this scenario.
Upvotes: 1