We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

need explanation of code piece in WPF DockingDemo2008

In Window1.xaml.cs I find the following code section. Could someone explain this to me?
private void InitWindowsFormsHost()
{
if( DockingManager.UseInteropCompatibilityMode )
{
WindowsFormsHost host = new WindowsFormsHost();
WinForms.Button btn = new WinForms.Button();
btn.Text = "Winows Forms Button";
host.Child = btn;
FindResults.Content = host;
WindowsFormsHost.EnableWindowsFormsInterop();
}
}

1 Reply

DC David C Syncfusion Team June 7, 2010 11:55 AM UTC

Hi Christoph,

Thanks for your interest in Syncfusion products.

Basically we set UseInteropCompatibilityMode to true when we use WinForms controls in DockingManager of WPF. By the code snippet, we place WinForms's Button inside of the ContentControl(FindResults). WindowsFormsHost.EnableWindowsFormsInterop() funtion enables a System.Windows.Forms.Form to function correctly when it is opened modelessly from WPF

Regards,
David C

Loader.
Live Chat Icon For mobile
Up arrow icon