This chapter extended the coverage of WPF with regard to how you can make your Windows Forms applications work with WPF controls. It introduced the WindowsFormsIntegration library and the capability to have WPF and Windows Forms components provide elements of an application user interface. Similar to other transitional libraries, the focus is on supporting business needs and not on complete support for the features of Windows Forms within the WPF environment. Key points from this chapter include the following:
It is possible to start a migration to a WPF-based application interface using the Windows - FormsIntegration library and the ElementHost class.
Such an interface enables you to embed enhanced image processing into an existing Windows Forms application.
Using the WindowsFormsHost class enables you to embed a complex business or third-party control that you are not ready to replace within a WPF application.
Using the Interoperability library can support key business-driven components, but it may impact the visual appeal of your user interface.
While this chapter introduced the new integration library, you may have noticed that this isn’t being advertised as the greatest feature. This isn’t because the feature didn’t require significant effort to create or wasn’t well designed. This library is an excellent resource - in the limited area for which it was designed: to support your transition from Windows Forms to WPF. Using this library across one or two releases of your application as you migrate to a WPF-based user interface is an excellent way to manage complexity, but always remember that you want to fully commit to the WPF-based paradigms, which means moving beyond this library.
Finally, if you do have the opportunity to create a complete new user interface and can avoid the added complexity associated with working with this integration class, then you should.