I’ve spent a lot of time with this problem. I have custom user control in wpf, It’s toolbar with 10 buttons. This toolbar is added in Panel(winform panel) panel.Controls.Add(usercontrol). What I want is, respond on MouseLeave event from Panel.
I’ve tried panel.MouseLeave += MouseLeaveEvent, but event hasn’t raised. No one event isn’t raised(MouseMove, etc.). Is there any solution, how to make it, that MouseLeave event will be raised?
Thanks a lot.
EDIT
Here is the code.
CustomToolbar = new AxisMediaControlToolbarViewModel(this);
var toolbarView = new AxisMediaControlToolbarView { ViewModel = CustomToolbar };
var elementHost = new ElementHost { Dock = DockStyle.Fill, Child = toolbarView };
toolbarPanel.Controls.Add(elementHost);
In this thread are quite a few causes mentioned:
EDIT
I made a test and it works fine as long as the WPF element is not covering the Panel. The mouse has to be DIRECTLY over the panel to generate the event. The DockStyle.Fill might be the cause of your problem.