Occurs after the conditional appearance is applied to the target UI element.
NuGet Package: DevExpress.ExpressApp.ConditionalAppearance
The AppearanceApplied event's data class is ApplyAppearanceEventArgs. The following properties provide information specific to this event:
|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 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.|
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:
Allows you to set the back color, font color and font style of the UI element supporting this interface.
Allows you to disable/enable the UI element supporting this interface.
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.