🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators Styles
Created by Hans.karlsen on 2023-07-21 · Last edited by Vale.buyondo on 2026-02-19.

The Styles operator is an OCL/EAL command used to access styles defined in StylesInModel.It allows you to reference a specific style by name and apply it in UI elements such as containers, rows, and columns.

Syntax

selfVM.Styles.StyleName

Example

In a ViewModel property (for example: Style Expression of a Row or Column or a Placing Container), the operator is used as follows:

selfVM.Styles.Search


selfVM: Refers to the current ViewModel instance.

Styles: Provides access to the collection of styles defined in the model (StylesInModel).

Search: The name of the specific style defined in the Style Editor.

Result

The expression returns the Style object named Search from StylesInModel.That style is then applied to the UI element where the Style Expression is set.

Usage Scenario

If you have created a style called Search in the model:

  1. Open the ViewModel Editor
  2. Select a Row, Column, or Control or placing container
  3. Set the Style Expression to: selfVM.Styles.Search

The UI element will render using the properties defined in the Search style.