ObjectDataProvider.ObjectType Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the type of object to create an instance of.

Namespace:   System.Windows.Data
Assembly:  PresentationFramework (in PresentationFramework.dll)

public Type ObjectType { get; set; }

Property Value

Type: System.Type

This property is null when the ObjectDataProvider is uninitialized or explicitly set to null. If ObjectInstance is assigned, ObjectType returns the type of the object or null if the object is null. The default value is null.

Exception Condition
InvalidOperationException

ObjectDataProvider is assigned both an ObjectType and an ObjectInstance; only one is allowed.

If DeferRefresh is used, ObjectInstance and Data do not update until Refresh is called.

<object ObjectType="myDataType"/>

myDataType

The data type to create an instance of. Use the x:Type Markup Extension to set a type.

.NET Framework
Available since 3.0
Return to top
Show: