Theme switching

You can switch the entire theme in the project properties, the theme editor or during runtime using a function. Controls allow you to switch between different theme classes within a theme at runtime. Individual control attributes can be assigned a theme property at runtime if they have been overwritten previously.

Switching in the properties

The default theme can be viewed and switched under the general project properties (click on the project node and open the Properties window).

Theme switching 1:

The theme editor features the Default Theme property in the header bar at the top, irrespective of the theme. There you can set the default theme in the same way as in the project properties.

Switching at runtime

The theme can be switched during runtime in the browser for each client. To do this, an action must be configured, e.g. on the .onPressed event of a button (so that the theme is switched when a specific button is pressed). In the Actions and Conditions editor, the Theme folder contains the SetTheme function under functions. Use drag & drop to add this function under the actions and enter the name of the theme by selecting it in the combo box.

Theme switching 2:

Switching classes

In certain cases it is necessary to switch not the entire theme, but only the properties of a group of elements or a particular control instance during runtime. This is possible if different theme classes are defined for the control. During runtime the attribute ClassNames of the control is then set again. To do this, an action must be configured at runtime, as for theme switching.

Theme switching 3:

Switching from control attributes to a theme

A control attribute, which is set by an attribute definition directly at the control (Level 1), can be set to the value of the currently active theme during runtime with the SetAttributeToThemeValue function. The value of the attribute is then changed according to the active theme each time the theme is switched.

Theme switching 4:

This function is used if individual control attributes are to be overwritten and then reset to the value of a theme.

Theme switching 5: