Skip to main content

AppearanceController.CustomApplyAppearance Event

This event occurs before the conditional appearance updates the target UI element.

Namespace: DevExpress.ExpressApp.ConditionalAppearance

Assembly: DevExpress.ExpressApp.ConditionalAppearance.v25.2.dll

NuGet Package: DevExpress.ExpressApp.ConditionalAppearance

Declaration

public event EventHandler<ApplyAppearanceEventArgs> CustomApplyAppearance

Event Data

The CustomApplyAppearance event's data class is ApplyAppearanceEventArgs. The following properties provide information specific to this event:

Property Description
AppearanceItems Gets the list of resulting items that were calculated by each appearance rule.
AppearanceObject The appearance that is currently applied to the target UI element.
ContextObjects An object(s) to whose property a conditional appearance is currently applied. If the target item is an Action, it’s the selected object(s) of the current View.
EvaluatorContextDescriptor Gets the EvaluatorContextDescriptor object that is used to supply metadata on the specified type to the ExpressionEvaluator objects.
Handled Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. Inherited from HandledEventArgs.
Item A UI element whose appearance is about to be refreshed by applying the appropriate conditional appearance rules.
ItemName The name of the UI element whose appearance is about to be refreshed by applying conditional appearance rules.
ItemType The type of the target UI element. Its appearance is refreshed when you apply conditional appearance rules.
ViewInfo Gets the information related to the current View.

Remarks

The AppearanceController.RefreshItemAppearance method raises this event. An AppearanceObject describes the resulting appearance that the event applies.

You can access and modify this object in the CustomApplyAppearance event handler with the ApplyAppearanceEventArgs.AppearanceObject property.

To identify the target item and context, use these parameters in the event handler:

Important

Set the Handled parameter to true if your code completely processes the appearance settings. Set it to false to allow default processing. Default processing can override your changes.

See the following table for supported appearance item types:

Item

Description

Supported Appearance types

AppearanceObjectAdapter

Accesses the arguments of the GridView.RowCellStyle event in the GridListEditor. Use the RowCellStyleEventArgs object from the adapter’s Data property for row cell or appearance settings.

Accesses the arguments of the TreeList.NodeCellStyle event in the TreeListEditor. Use the GetCustomNodeCellStyleEventArgs object from the adapter’s Data property for node cell or appearance settings.

IAppearanceFormat

GridViewRowCellStyleEventArgsAppearanceAdapter, GridViewCancelEventArgsAppearanceAdapter, GridViewCancelEventArgsAppearanceAdapterWithReset

Accesses the GridView and EventArgs objects passed to ColumnView.ShowingEditor and GridView.RowCellStyle events to customize grid cells and editors.

IAppearanceFormat, IAppearanceEnabled

NodeCellStyleEventArgsAppearanceObjectAdapter

Accesses the TreeList and GetCustomNodeCellStyleEventArgs objects when the system applies appearance to Tree List cells.

IAppearanceFormat

WinLayoutItemAppearanceAdapter

Accesses a XAFLayoutItemInfo object representing a layout item or group. The system creates this item with the WinLayoutManager and when the AppearanceController.Refresh method runs. Use the adapter’s Data property for access.

IAppearanceFormat, IAppearanceVisibility

DevExpress.ExpressApp.Editors.ColumnWrapper

This column appears in a GridListEditor and TreeListEditor. The system applies conditional appearance to each column at creation.

IAppearanceVisibility

PropertyEditor

The system applies conditional appearance to every PropertyEditor class descendant when controls are created and when the AppearanceController.Refresh method runs.

IAppearanceEnabled, IAppearanceVisibility

DXPropertyEditor

The system applies conditional appearance to every DXPropertyEditor class descendant at creation and when the AppearanceController.Refresh method runs.

IAppearanceFormat

StaticText

The system applies conditional appearance to Static Text Detail View Items at creation and when the AppearanceController.Refresh method runs.

IAppearanceFormat

ActionAppearanceItem

The system applies conditional appearance to objects of this type when the AppearanceController.Refresh method runs. Use the item’s Data property to access the affected Action.

IAppearanceEnabled, IAppearanceVisibility

For event handler examples, refer to the following topic: How to: Customize the Conditional Appearance Module Behavior.

Note

Instead of directly accessing the editor’s control, you can customize the appearance object. Iterate through the ApplyAppearanceEventArgs.AppearanceItems list to select the required item.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CustomApplyAppearance event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also