DesignInstanceExtension

MarkupExtensionSince v2.13
[MarkupExtensionReturnType(object)] public class DesignInstanceExtension : MarkupExtension
Creates sample data for the designer, e.g. d:DataContext="{d:DesignInstance local:MyViewModel}"
Remarks: The type also tells the editor which properties {Binding} can use. Returns null outside of Control.IsDesignMode, or when the type has no parameterless constructor.

Constructors

DesignInstanceExtension

#
public DesignInstanceExtension()
Initializes a new instance of the DesignInstanceExtension class

DesignInstanceExtension

#
public DesignInstanceExtension(Type type)
Initializes a new instance of the DesignInstanceExtension class with the specified type

Properties

Type

#
[ConstructorArgument("type")] public Type Type { get; set; }
Gets or sets the type of object to create

Methods

ProvideValue

#
public override object ProvideValue(IServiceProvider serviceProvider)