AppearanceController.RefreshItemAppearance(View, String, String, Object, Object) Method

Collects and applies the conditional appearance rules appropriate for the specified UI element.

Namespace: DevExpress.ExpressApp.ConditionalAppearance

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

Declaration

public void RefreshItemAppearance(
    View view,
    string itemType,
    string itemName,
    object item,
    object contextObject
)
Public Sub RefreshItemAppearance(
    view As View,
    itemType As String,
    itemName As String,
    item As Object,
    contextObject As Object
)

Parameters

Type Name Description
View view

A View object that is the View in which the target UI element (View Items and Layout Items and Groups) is contained. If the target UI element is an Action, this View is the one for which it is activated.

String itemType

A string that is the type of the target UI element whose conditional appearance is about to be refreshed.

String itemName

A string that is the identifier of the UI element whose conditional appearance is about to be refreshed.

Object item

A UI element whose conditional appearance is about to be refreshed by applying the appropriate rules.

Object contextObject

An object that contains the properties whose controls or layout items are about to be refreshed by applying the appropriate rules. When the target item is an Action, the selected object(s) is passed as this parameter.

To collect rules appropriate for the target item, this method first scans the Application Model's BOModel | <Class> | AppearanceRules node corresponding to the business object represented by the View passed as the view parameter. To access the list of the rules found, handle the AppearanceController.CollectAppearanceRules event. In the event handler, you can declare conditional appearance rules for a particular item dynamically and add them to the rules list returned by the CollectAppearanceRulesEventArgs.AppearanceRules event handler parameter.

After rules for the target item are collected, they are reviewed, to leave only those rules that satisfy the following conditions:

To apply the rules to the target item, an AppearanceObject is generated. This object contains a list of the appearances (Enabled, Visible, BackColor, FontColor and FontStyle) to be applied to the target item. These appearances are received by combining all the rules found according to their priority (see IAppearance.Priority). To access the AppearanceObject, handle the AppearanceController.CustomApplyAppearance event and use the ApplyAppearanceEventArgs.AppearanceObject event handler parameter.

The apply the resulting appearance to the target item, this item should implement any set of the following interfaces:

To apply a custom conditional appearance to a particular item, handle the AppearanceController.CustomApplyAppearance event and set the event handler's Handled parameter to true to avoid applying the prepared appearance.

To customize the applied appearance, handle the AppearanceController.AppearanceApplied event.

The RefreshItemAppearance method is called by the View Controllers registered in the Appearance Controller when the AppearanceController.Refresh method is invoked (see AppearanceController.RegisterController). In addition, this method is called separately by different View Controllers to apply conditional appearance rules to UI elements in particular situations. You can also call this method, when required, from any View Controller.

See Also