ViewController.TargetObjectType Property

Specifies the type of objects that must be represented by a View to provide View Controller activation.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.2.dll

Declaration

public Type TargetObjectType { get; set; }
Public Property TargetObjectType As Type

Property Value

Type Default Description
Type

null

A Type object that represent a persistent object's type.

View Controllers are activated for both Windows and Frames. However, you can specify the type of objects represented by a View to provide a View Controller activation. For this purpose, specify the TargetObjectType property in code or the Designer.

To make a single View Controller available in Views of different business object types simultaneously, set the TargetObjectType property in code to an interface or their base class type, which is implemented or inherited by all these business types respectively. Also, for the same task, you can specify several View identifiers using the ViewController.TargetViewId property.

Note

The TargetObjectType property affects only ViewController's activation. Controller.FrameAssigned and other events that are irrelevant to the object type always fire.

Alternatively, you can implement the generic ObjectViewController<ViewType, ObjectType> Controller instead of the ViewController and specify the View's and object's type, for which this Controller should be activated, in the ViewType and ObjectType generic parameters.

See Also