ViewItem Class
Represents a base class for View Items.
Namespace: DevExpress.ExpressApp.Editors
Assembly: DevExpress.ExpressApp.v24.2.dll
NuGet Package: DevExpress.ExpressApp
#Declaration
#Related API Members
The following members return ViewItem objects:
#Remarks
The ViewItem
class implements basic functionality for items that can be contained in a Detail View. This functionality includes:
The capability to display View Items via a specified control in a UI. Basically, a Detail View’s representation in a UI is a set of controls that display View Items.
See the following members: ViewItem.Control, ViewItem.CreateControl, ViewItem.ControlCreating and ViewItem.ControlCreated.
A View Item can be related to the object that the parent Detail View presents. For instance, the PropertyEditor, being the
ViewItem
class’ descendant, represents the properties of the object presented by the Detail View.See the ViewItem.CurrentObject and ViewItem.ObjectType.
A View Item can be refreshed when the parent Detail View is refreshed. Refreshing is assumed to be data related.
See ViewItem.Refresh.
The capability to save the current settings of the control to the Application Model, so that the next time the control is created the same settings are used.
See ViewItem.SaveModel.
To access the Detail View in which a View Item is contained, use the ViewItem.View property.
XAF ships with the following descendants of the ViewItem
class:
-
Displays an Action Container specified by the IModelActionContainerViewItem.ActionContainer property of the Application Model‘s corresponding ActionContainerViewItem node. Used to display Actions on a Detail View layout.
-
Displays a control specified by the IModelControlDetailItem.ControlTypeName property of the Application Model‘s corresponding ControlDetailItem node. So, you can specify a control (Windows Forms or ASP.NET Web Forms) that will be displayed in a UI. This View Item type is declared in the DevExpress.ExpressApp.dll assembly and is UI independent.
-
Displays a View in a nested Frame. Used to display several Views side-by-side on a Dashboard View.
-
Displays a control bound to a property of the current View’s object. There are multiple property editor types in the XAF. They are intended for different data types, and therefore use different controls.
-
Displays an image.
-
Displays a label.
To implement a custom View Item, inherit from the ViewItem class. The following protected members that are not described in the documentation can be overridden:
Member | Description |
---|---|
Create |
Called by the View |
Save |
Called by the View |
Dispose |
Called by the View |
On and On |
Called when the View |
On and On |
Called when a control (see View |
Note
A custom View Item should be implemented in a platform-specific application project and decorated with the View
For details on View Items and basics on how to implement custom ones, refer to the View Items and How to: Implement a View Item topics.
To access a View Item of the View for which a Controller is activated, handle the Controller.Activated and ViewItem.ControlCreated events, as it is demonstrated in the following article: Access the Settings of a Property Editor in a Detail View.