views:

93

answers:

1

Hey folks , i'm working with 3 projects , one C# (let's called it A ) the other two are Wpf projects(let's call them B,C).

The project B has a main window which contains a button ,when i press the button it shows the project "A" main's window .(i've done that by adding the right references and doing the code below in button click event handler :

            CsharpForm.Form1 d = new CsharpForm.Form1();
            d.ShowDialog();

, but The Problem i have now is how do to the opposite ??

i have a button in project "C"(wpf one ) and want it to open a window of project "a" (C# )

Do u know any idea about this ?

+2  A: 

Use ElementHost

var wpfwindow = new WPFWindow.Window1();
ElementHost.EnableModelessKeyboardInterop(wpfwindow);
wpfwindow.Show();
Veer
thankx it was helpful by the way i could manage this without the following line ElementHost.EnableModelessKeyboardInterop(wpfwindow);
Wazzz
@Wazzz: If you don't want to handle keyboard inputs, then it's fine. You can get rid of that line.
Veer