>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Windows Form Into WPF
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
App WPF che apre WinForms
1. impostare rife a lib System.Windows.Forms (in prj WPF)
2. impostare un riferimento al progetto WinForms (in prj WPF)
3. chiamare un istanza della lib WinForm come new <WinFormName> ed invocare il metodo .Show()
4. migliorare l’interoperabilità con la tastiera =>
andare in App.xaml.cs e allo startup dell’applicazione
protected override void OnStartup(StartupEventesArgs e)
{
WinFormHost.EnableWindowsFormsInterop();
base.OnStartup(e);
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
WPF Into Windows Form
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
App winForm che apre WPF
1. Impostare riferimento a WindowsFormIntegration (in prj WinForm)
2. impostare un riferimento alla libreria WPFLib (in prj WinForm)
3. chiamare un istanza della WPFlib come new
private void button1_click(object sender, EventArgs e)
{
WPFLib wpfIntoWin = new WPFLib;
//ATTENZIONE Aggiungere questa riga per ogni maschera che deve essere aperta
ElementHost.EnableModelessKeyboardInterop(wpfIntoWin);
wpfIntoWin.Show();
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CTRL Windows Form Into WPF
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CTRL WPF Into Windows Form
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<