WPF Interoperability: How to get Reference of Host Windows Form in WPF User Control
I've developed an Outlook Addin and UI of the addin is created in WPF. The WPF User controls are hosted in the Windows Forms. All my functionality resides inside the WPF user controls and I've provided a Close form functionality. Can somebody tell me how to get the reference of the Windows Form in the code behind of WPF user control which is hosted in the elementhost available in the Windows Form, s开发者_StackOverflow中文版o that I can put the frmHost.Hide() code in the WPF user control.
Thanks Nitin
I'm not familiar with WPF Outlook addin, but in the control hierarchy, I suppose your WPF control is ultimately the (grand) child of an ElementHost control. Once you have a reference to it, you can get to the Winform host (Parent property, etc.).
精彩评论