Is WindowsFormsHost fit for purpose (.net WPF hosting WinForms)?

A GUI driven application needs to host some prebuilt WinForms based components. These components provide high performance interactive views using a mixture of GDI+ and DirectX. The views handle control input and display custom graphical renderings. The components are tested in a WinForms harness by the supplier.

Can a commericial application use WPF for its GUI and rely on WindowsFormsHost to host the WinForms components or have you experience of technical glitches e.g. input lags, update issues that would make you cautious?

Answers


We're currently using WindowsFormsHost in our software to host the WinForms DataGridView control, and we've not had any real problems with it. A few things to watch out for though:

The first is the air-space restrictions. Practically speaking, this means that WinForms content always appears on top of WPF content. So if you are using WPF adorners they will appear to be "trimmed" if they hit up against a WinForms region in your app.

The second is that, because they use Windows resources, you have to manage the lifetimes of WinForms components more carefully. Unlike WPF components, WinForms controls expect to be Disposed when they're finished with. This makes it tricky to include them in a pure XAML view.

The last thing is that WinForms controls don't seem to resize as smoothly as the rest of the WPF display: they tend to snap to their new size once you've finished making an adjustment.


Need Your Help

Loading a instance of a class dynamically in swift

ios swift uiviewcontroller xib nib

I would like to init an instance of a class specified at runtime. I have the following set up.

asp.net application, sql server & web services

.net asp.net sql-server web-services

I have no experience on connecting web apps to a SQL server on a different machine through web services.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.