System.Windows.Forms.Integration 命名空間

包含支援 Windows Forms 和 WPF 控制項互通的類別。 Contains classes that support interoperation of Windows Forms and WPF controls.



提供 ChildChangedChildChanged 事件的資料。Provides data for the ChildChanged and ChildChanged events.


Windows Form 控制項,可以用來裝載 Windows Presentation Foundation (WPF) 項目。A Windows Forms control that can be used to host a Windows Presentation Foundation (WPF) element.


EventArgs 類別提供基底類別,這些類別支援選擇性引發例外狀況。Provides a base class for EventArgs classes which support optionally raising exceptions.


提供 LayoutError 事件的資料。Provides data for the LayoutError event.


提供一種方式,以轉譯 Windows Forms 控制項和 Windows Presentation Foundation (WPF) 項目之間的屬性值。Provides a way to translate property values between Windows Forms controls and Windows Presentation Foundation (WPF) elements.


提供 PropertyMappingError 事件的資料。Provides data for the PropertyMappingError event.


可讓您將 Windows Forms 控制項裝載於 WPF 頁面上的元素。An element that allows you to host a Windows Forms control on a WPF page.



為主控制項的對應屬性提供轉譯函式。Provides a translation function for a mapped property of the host control.


System.Windows.Forms.Integration命名空間包含類別,可讓之間的互通性Windows FormsWindows FormsWPFWPF技術。The System.Windows.Forms.Integration namespace contains classes that enable interoperation between the Windows FormsWindows Forms and WPFWPF technologies. 當您使用System.Windows.Forms.Integration類別,您可以裝載Windows FormsWindows Forms上的控制項WPFWPF頁面,並WPFWPF中的項目Windows FormsWindows Forms-架構應用程式。When you use System.Windows.Forms.Integration classes, you can host Windows FormsWindows Forms controls on WPFWPF pages, and WPFWPF elements in Windows FormsWindows Forms-based applications.

實作交互操作功能的兩個主要類別是WindowsFormsHostElementHostThe two key classes that implement interoperation capabilities are WindowsFormsHost and ElementHost. 使用的類別取決於您的控制項實作:Which class you use depends on your control implementation:

  • 使用 WindowsFormsHost類別時,您必須使用Windows FormsWindows Forms控制WPFWPF頁面。Use the WindowsFormsHost class when you must use a Windows FormsWindows Forms control on a WPFWPF page.

  • 使用ElementHost類別時,您必須使用WPFWPF中的項目Windows FormsWindows Forms為基礎的應用程式。Use the ElementHost class when you must use a WPFWPF element in a Windows FormsWindows Forms-based application.