Share via


InstanceFactory.CreateInstance Method

Creates an instance of the specified type.

Namespace:  Microsoft.Windows.Design.Model
Assembly:  Microsoft.Windows.Design.Extensibility (in Microsoft.Windows.Design.Extensibility.dll)

Syntax

'Declaration
Public Overridable Function CreateInstance ( _
    type As Type, _
    ParamArray arguments As Object() _
) As Object
'Usage
Dim instance As InstanceFactory 
Dim type As Type 
Dim arguments As Object()
Dim returnValue As Object 

returnValue = instance.CreateInstance(type, _
    arguments)
public virtual Object CreateInstance(
    Type type,
    params Object[] arguments
)
public:
virtual Object^ CreateInstance(
    Type^ type, 
    ... array<Object^>^ arguments
)
public function CreateInstance(
    type : Type, 
    ... arguments : Object[]
) : Object

Parameters

  • arguments
    Type: array<System.Object[]

    An optional array of arguments to pass into the constructor.

Return Value

Type: System.Object
A newly created object. The return value should not return nulla null reference (Nothing in Visual Basic).

Exceptions

Exception Condition
ArgumentNullException

type is nulla null reference (Nothing in Visual Basic).

.NET Framework Security

See Also

Reference

InstanceFactory Class

InstanceFactory Members

Microsoft.Windows.Design.Model Namespace

Other Resources

WPF Designer Extensibility Architecture