I have a WinForms menuitem and I need that on menu click the new WPF dialog is loaded.
How do I do this?
Thanks
I have a WinForms menuitem and I need that on menu click the new
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should be able to display it by creating a new instance of the WPF class for the dialog, and then calling its ShowDialog() method.
The only trick is properly setting the owner of the WPF dialog. You can’t just set the Owner property directly, since that requires a WPF window. However, you can use the class System.Windows.Interop.WindowInterpHelper to get around this:
(I got the code sample from http://blog.stpworks.com/archive/2009/07/02/setting-wpf-dialog-owner-from-within-winforms-application.aspx.)