How to change the main theme colors of a C# MAUI application during runtime?
My MAUI application is split into a login page and two shells for each type of user (normal, the theme is blue, and administrative, which is themed red), and I want not only the things inside the shell to be color-themed, but also the stuff outside of it, like the base colors. From the beginning, a lot of colors are set to blue in Resources/Styles/Colorx.xaml
and Platforms/Android/Resources/Values/colors.xaml
, which is fine because both the login page and the normal user shell are supposed to be blue. However, the administrative part looks bad if some parts are red and some are blue, so I want to change these colors to red if the user has administrative permissions. Let’s say, UserIsAdministrative()
is being triggered. What do I need to do to change the resources?