NeedsManagedWrapperAttribute

Overview

The NeedsManagedWrapperAttribute attribute class defines whether a special wrapper class needs to be provided to be able to use custom interfaces. Special wrapper classes are needed when using custom interfaces inside WPF plugins, because of WPF limitations that block COM interop inside WPF classes.

Use Case

You have to use this attribute when you use custom interfaces to interact with WPF plugins. For example:

    [Plugin, VisualPlugin, NeedsManagedWrapper(typeof(VisualizerWrapper))]
    public partial class Plugin : RemObjects.Hydra.WPF.VisualPlugin, IVisualizerControl

The attribute indicates that the wrapper class should be used to interact with the custom interface, and defines the type of wrapper class that will be used.

The following example shows the wrapper class that will be created by the host to interact with the custom interface:

    [Guid("6df54f69-0022-4d6f-b755-d855d92d4b96")]
    public class VisualizerWrapper : VisualPluginWrapper, IVisualizerControl

Note: Please look at the Delphi WPF sample shipped with Hydra to see wrapper classes in action.

Location


Properties


WrapperType

Holds the wrapper class type that will be used to interact with the custom interfaces.

 

property WrapperType: Type read write;

 

Type WrapperType { get; set; }

 

Property WrapperType() As Type

Instance Methods


constructor

Creates a new instance of the NeedsManagedWrapperAttribute.

 

constructor

 

NeedsManagedWrapperAttribute()

 

Sub New()

constructor (Type)

 

constructor(wrapperType: Type)

 

NeedsManagedWrapperAttribute(Type wrapperType)

 

Sub New(wrapperType As Type)

Parameters:

  • wrapperType: