WPF-XAML window in Winforms Application
I have a Winforms application coded in VS C# 2008 and want to insert a WPF window into the window pane of Winforms application.
Could you explain me how this is don开发者_如何学Ce.
You need to use an ElementHost.
ElementHost es = new ElementHost();
es.HostContainer.Children.Add(screen); // where screen is your wpf window or user control
es.Dock = Windows.Forms.DockStyle.Fill; // probably want to fill the element host. Not necessary
somePanel.Controls.Add(es); // add the element host to a panel on your Winform or the form itself
Hope that helps
精彩评论