WPF & Interop – what about Java Swing?
- HwndSource – allows you to host WPF content inside of an HWND.
- <HwndHost /> – allows you to host an HWND inside of WPF content.
Snippet from SDK Overview for Win32/WPF interop:
Windows Presentation Foundation (formerly code-named "Avalon") provides a rich environment for creating applications. However, when you have a substantial investment in Microsoft Win32 code, it may be more effective, at least in the short-term, to reuse some of that code. There are two basic ways to interoperate Windows Presentation Foundation and Win32 code.
Host a Windows Presentation Foundation page in a Win32 window.This allows you, for instance, to use the advanced graphics capabilities of Windows Presentation Foundation within the framework of a standard Win32 window and application.
Host a Win32 window on a Windows Presentation Foundation page. This allows you, for instance, to use a custom Win32 control in the context of a Windows Presentation Foundation page.
This document provides an overview of how to interoperate Windows Presentation Foundation and Win32 code. It is accompanied by two detailed walkthroughs, Walkthrough: Hosting a Simple Win32 Control in a Windows Presentation Foundation Application and Walkthrough: Hosting a Windows Presentation Foundation Page in a Win32 Application, which take you through simple working examples of the two scenarios.
- IFrame/Frame in IE – can host browser apps (.xbap) or XAML pages
- <Frame />- allows you to host other XAML pages or HTML pages.
- ElementHost – allows you to host WPF content inside of a Windows Forms application.
- <WindowsFormsHost /> – allows you to host a Windows Forms control inside of WPF content.
Snippet from SDK Overview for WindowsForms Interop:
Windows Presentation Foundation and Windows Forms present two different architectures for creating application interfaces. The System.Windows.Forms.Integration namespace provides classes that enable common interoperation scenarios. The two key classes that implement interoperation capabilities are WindowsFormsHost and ElementHost. This topic describes which interoperation scenarios are supported and which scenarios are not supported.