This documentation is archived and is not being maintained.

FrameworkElementAdapters Class

FrameworkElementAdapters is used by Windows Presentation Foundation (WPF) add-ins to convert between a FrameworkElement and an INativeHandleContract.


Namespace:  System.AddIn.Pipeline
Assembly:  System.Windows.Presentation (in System.Windows.Presentation.dll)

public static class FrameworkElementAdapters

The FrameworkElementAdapters type exposes the following members.

Public methodStatic memberContractToViewAdapterReturns a FrameworkElement that has been converted from an INativeHandleContract.
Public methodStatic memberViewToContractAdapterReturns an INativeHandleContract that has been converted from a FrameworkElement.

Windows Presentation Foundation (WPF) extends the Microsoft .NET Framework add-in model to allow WPF UIs to be passed between host applications and add-ins. WPF requires that the WPF UIs that are passed either directly or indirectly derive from FrameworkElement. However, add-ins and host applications are typically run in separate application domains and are, consequently, separated by an isolation boundary. For this reason, the .NET Framework add-in model requires the types that are passed across the isolation boundary to be remotable. A remotable type conforms to one of the following:

FrameworkElement is not remotable and must be converted to a remotable type before it is passed across the isolation boundary between an add-in and a host application. For this purpose, you need to call the static ViewToContractAdapter method to convert the FrameworkElement to an instance of the remotable INativeHandleContract.

Once the INativeHandleContract is passed across the isolation boundary, it must be converted to a type that can be displayed by the host application or the add-in. In this case, the static ContractToViewAdapter method is called to convert an INativeHandleContract to a FrameworkElement.

For more detailed exposition of WPF add-ins, see WPF Add-Ins Overview.

.NET Framework

Supported in: 4, 3.5

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.