The requested page is not available for the requested platform. You are viewing the content for Default platform.

AppearanceController.AppearanceApplied Event

Occurs after the conditional appearance is applied to the target UI element.

Namespace: DevExpress.ExpressApp.ConditionalAppearance

Assembly: DevExpress.ExpressApp.ConditionalAppearance.v19.1.dll

Declaration

public event EventHandler<ApplyAppearanceEventArgs> AppearanceApplied
Public Event AppearanceApplied As EventHandler(Of ApplyAppearanceEventArgs)

Event Data

The AppearanceApplied event handler receives an argument of the ApplyAppearanceEventArgs type. 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.
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 UI element whose appearance is about to be refreshed by applying conditional appearance rules.
View Obsolete. Gets the current View.
ViewInfo Gets the information related to the current View.

Remarks

The AppearanceController applies conditional appearance rules declared for the target UI element. The Controller collects them from the Application Model, filters them leaving only those that satisfy the specified conditions and criteria, and combines them to the AppearanceObject according the specified priority. The AppearanceObject specifies whether to enable/disable the target item, make it invisible/visible, set the item's background color, font color or font style. If you need to change one or several of these appearance settings after they have been applied, handle the AppearanceApplied event. In this instance, if other appearance settings specified by the AppearanceObject has been applied, you will leave them as is. To get the target item, use the event handler's ApplyAppearanceEventArgs.Item, ApplyAppearanceEventArgs.ItemName and ApplyAppearanceEventArgs.ItemType parameters. To access the conditional appearance applied, use the event handler's ApplyAppearanceEventArgs.AppearanceObject parameter. To get the context object(s), use the ApplyAppearanceEventArgs.ContextObjects parameter. To customize the applied appearance, access the target item and cast it by one of the following interfaces:

  • IAppearanceFormat

    Allows you to set the back color, font color and font style of the UI element supporting this interface.

  • IAppearanceEnabled

    Allows you to disable/enable the UI element supporting this interface.

  • IAppearanceVisibility

    Allows you to hide/show the UI element supporting this interface.

Casting the target item to one of the interfaces above, you can reset the applied appearance settings. For this purpose, use the corresponding interface methods.

If these interfaces do not provide the required appearance settings, use the item's properties directly. To learn which items may present as appearance items, see the table in the AppearanceController.CustomApplyAppearance event description.

To apply a custom conditional appearance, handle the AppearanceController.CustomApplyAppearance event. Set the Handled event handler parameter to true so that the appearance settings specified by the AppearanceObject do not override your custom appearance.

Refer to the How to: Customize the Conditional Appearance Module Behavior topic to see an example of handling this event.

See Also