InstanceInitializer.CreateInstance(TypeInfo) Method

Creates an instance of the specified type.

Namespace: DevExpress.Xpf.PropertyGrid

Assembly: DevExpress.Xpf.PropertyGrid.v20.1.dll

Declaration

public virtual object CreateInstance(
    TypeInfo type
)
Public Overridable Function CreateInstance(
    type As TypeInfo
) As Object

Parameters

Name Type Description
type DevExpress.Mvvm.Native.TypeInfo

The instance type.

Returns

Type Description
Object

The created instance.

Remarks

The PropertyGrid control supports adding new objects to collections using the collection editor. To pre-set certain properties for a new object or create an object without the default constructor, use the CollectionDefinition.NewItemInitializer property. Like PropertyDefinitionBase.InstanceInitializer, it should be set to an object that implements the DevExpress.Mvvm.Native.IInstanceInitializer interface.

<Application x:Class="pgrid_collection.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <Application.Resources>

    </Application.Resources>
</Application>

Implements

DevExpress.Mvvm.Native.IInstanceInitializer.CreateInstance(DevExpress.Mvvm.Native.TypeInfo)
See Also