FrameworkElementAdapters Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
FrameworkElementAdapters is used by Windows Presentation Foundation (WPF) add-ins to convert between a FrameworkElement and an INativeHandleContract.
public ref class FrameworkElementAdapters abstract sealed
public static class FrameworkElementAdapters
type FrameworkElementAdapters = class
Public Class FrameworkElementAdapters
- Inheritance
-
FrameworkElementAdapters
Remarks
Windows Presentation Foundation (WPF) extends the .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:
Implements the ISerializable interface.
Has the SerializableAttribute attribute applied.
Derives from the MarshalByRefObject class.
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.
Methods
ContractToViewAdapter(INativeHandleContract) |
Returns a FrameworkElement that has been converted from an INativeHandleContract. |
ViewToContractAdapter(FrameworkElement) |
Returns an INativeHandleContract that has been converted from a FrameworkElement. |