Vilx-
Vilx-

Reputation: 106904

WPF: OnMouseLeftButtonDown not called

I'm creating a control which is derived from Panel. When mouse is clicked on one of the children it gets the OnMouseLeftButtonDown overriden method called. When mouse is clicked on the control itself, there is no event. How come?

Upvotes: 0

Views: 474

Answers (1)

Kenan E. K.
Kenan E. K.

Reputation: 14111

If you have no Background set on the Panel, it is not only transparent, but also mouse-transparent.

This is usually set via a TemplateBinding in the default style for your custom control.

Upvotes: 2

Related Questions