I am hosting windowsforms control in WPF popup. Problems below:
- If i make StaysOpen=False i can't interact with winform control. StaysOpen to false is required because when clicked outsidet the Popup region, it should close.
- if i make StaysOpen=True i can interact with winform control but when i click outside the area of popup, it is not getting closed.
- I tried setting StaysOpen=true in MouseEnter of popup and StaysOpen=False in MouseLeave, but MouseLeave fires as and when mouse is over winform control resulting in unexpected behaviour.
I even tried IsMouseCaptureWithin property of popup and found it does not work with winforms (i guess its a bug in framework).
Another problem, i was trying to close popup when root main form (which is windows form) is deactivated (pressed Alt+Tab), but this event (deactivate) is fired even when i enter into one of the controls in windowshostControl in popup.
Desired Behaviour:
- should be able to host and interact with winform control in wpf popup.
- on clicking on outside the area of popup, popup should close.
Appreciate any inputs.
Thanks.