<p>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.</p>

<p>Can a commericial application use WPF for its GUI and rely on <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.windowsformshost.aspx" rel="noreferrer" title="WindowsFormsHost">WindowsFormsHost</a> to host the WinForms components or 
have you experience of technical glitches e.g. input lags, update issues that would make you cautious?</p>

[{'answer_id': 53801, 'author': 'aku', 'author_id': 1196, 'author_profile': 'https://Stackoverflow.com/users/1196', 'pm_score': 0, 'selected': False, 'text': "<p>I hosted WPF controls in WinForms and vice versa without problems. Though, I would test such scenarios extensively 'cause it's hard to predict how complex control will behave.</p>\n"}, {'answer_id': 53855, 'author': 'Kent Boogaart', 'author_id': 5380, 'author_profile': 'https://Stackoverflow.com/users/5380', 'pm_score': 0, 'selected': False, 'text': "<p>Do note the absence of a WPF <code>Application</code> object when hosting in Winforms. This can result in problems if you're taking an existing WPF component and hosting it in Winforms, since resource lookups and the likes will never look in application scope. You can create your own <code>Application</code> object if it is a problem.</p>\n"}, {'answer_id': 53870, 'author': 'Samuel Jack', 'author_id': 1727, 'author_profile': 'https://Stackoverflow.com/users/1727', 'pm_score': 5, 'selected': True, 'text': '<p>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:</p>\n\n<p>The first is the <a href="http://msdn.microsoft.com/en-us/library/aa970688.aspx" rel="noreferrer">air-space restrictions</a>. 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.</p>\n\n<p>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.</p>\n\n<p>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.</p>\n'}, {'answer_id': 53876, 'author': 'David Mohundro', 'author_id': 4570, 'author_profile': 'https://Stackoverflow.com/users/4570', 'pm_score': 0, 'selected': False, 'text': '<p>As <a href="https://stackoverflow.com/questions/53796/is-windowsformshost-fit-for-purpose-net-wpf-hosting-winforms#53855">@Kent Boogaart mentioned</a>, I\'ve run into the situation where a WPF application hosted in WinForms doesn\'t have the WPF Application object (i.e. Application.Current). This can cause many issues such as Dispatchers not invoking threads back to the UI thread. This would only apply if you\'re hosting in WinForms, not the other way around.</p>\n\n<p>I\'ve also had strange issues with modal dialogs behaving strangely (i.e. ShowModal calls). I\'m assuming this is because, in WinForms, each control has its own Win32 handle while in WPF, there is only one handle for the entire Window.</p>\n\n<p>Whatever you do, test :)</p>\n'}, {'answer_id': 54356, 'author': 'Artur Carvalho', 'author_id': 1013, 'author_profile': 'https://Stackoverflow.com/users/1013', 'pm_score': 0, 'selected': False, 'text': '<p>You can solve the Airspace problem by using .net 3.5 SP1:</p>\n\n<blockquote>\n  <p>These types of airspace restrictions\n  represent a huge limitation in a\n  framework, like WPF, where element\n  composition is used to create very\n  rich user experiences. With a D3DImage\n  solution, these restrictions are no\n  longer present!</p>\n</blockquote>\n\n<p>See <a href="http://www.codeproject.com/KB/WPF/D3DImage.aspx" rel="nofollow noreferrer">Introduction to D3DImage</a>.</p>\n'}, {'answer_id': 70064, 'author': 'AndyL', 'author_id': 9944, 'author_profile': 'https://Stackoverflow.com/users/9944', 'pm_score': 2, 'selected': False, 'text': '<p>One problem I\'ve run into is that embedded Win Forms controls do not participate in any transform operations applied to their WPF container.  This results in visual flashing effects and the embedded control appearing in an innappropriate location.  I worked around this by binding the visibility of the Windows Forms Host to the animation state of its WPF container, so that the embedded control was hidden until the animation completed, like below.</p>\n\n<pre><code>&lt;WindowsFormsHost Grid.Row="1" Grid.Column="1" Margin="8,0,0,0"\n     Visibility="{Binding ActualHeight, RelativeSource={RelativeSource\n     Mode=FindAncestor, AncestorType=UserControl},\n     Converter={StaticResource WinFormsControlVisibilityConverter}}" &gt;\n\n     &lt;winforms:DateTimePicker x:Name="datepickerOrderExpected" Width="140"\n        Format="Custom" CustomFormat="M/dd/yy  h:mm tt"\n        ValueChanged="OnEditDateTimeOrderExpected" /&gt;\n\n&lt;/WindowsFormsHost&gt;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/53796', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/5427/']