共用方式為


IViewElementFactory Interface

Definition

Converts from an object to its equivalent platform specific UI element.

public interface class IViewElementFactory
public interface IViewElementFactory
type IViewElementFactory = interface
Public Interface IViewElementFactory

Examples

[Export(typeof(IViewElementFactory))]
[Name("My object converter")]
[TypeConversion(from: typeof(object), to: typeof(UIElement))]
[Order(Before = "Default object converter")]

Remarks

This type allows the same intermediate type to be rendered on different platforms through the use of platform specific exports that live in that platform's UI layer.

You must specify the type converted from and the type converted to using TypeConversionAttribute.

You can supersede an existing IViewElementFactory converting for the same (to, from) pair via MEF OrderAttributes.

Methods

CreateViewElement<TView>(ITextView, Object)

Converts model into an equivalent object of type TView.

Applies to