Change the active theme
By default an app will use the theme set in App settings. To set a different theme you need to run an action, either automatically or triggered by the user, that contains the Set theme action node. The selected theme is stored in the built-in App variable Active Theme.
Step 1
Add a Select component to the UI with Value bound to App Variables.Active Theme
. In the app, the drop-down list will be populated with the themes that you have added to your solution and the active theme will be selected.
Step 2
Use the On Value Change event handler of the Select component to run a new action. In that action, add the Set theme action node. Set the Theme from data property to App Variables.Active Theme
. Now, when a new selection is made from the drop-down in the UI, the active theme will be applied to the app for that user.
Note that this configuration will not store the user's selection for future sessions. To do that, you might want to store their preference in an object attached to their user. Then, you can run an action using the On app load event handler with Set theme and Theme from data bound to the object class property where you have the preference stored.
Last updated