How to allow user configurable light and dark colours to be bindable #16305
-
We have a number of ways to set light and dark colours for a control, but I can't see a way to make those colours bindable. So we have a situation where we have to refresh the entire UI after a user has made a colour config change. Am I missing something or is this just not possible with Maui? We implemented dark mode in Xamarin Forms before Microsoft did, and we built that to work with multi binding and bindable properties for those colours, plus property converters. You know, how developers would want to use it. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Have you tried AppThemeBinding? |
Beta Was this translation helpful? Give feedback.
-
Not sure if this is what you are looking for, we do not use AppThemebinding at all we have many themes if you like so the approached used here is that given a set of themes the user chooses a theme and the app changes the color scheme . and we have some pages where we bind a color to a control and the user can change the color too but always bound to a resource dictionary where the colors are defined |
Beta Was this translation helpful? Give feedback.
-
@JohnHDev glad it helped we have used it successfully in both XF and Maui in switching between LightTheme vs DarkTheme all driven by swapping resource dictionaries |
Beta Was this translation helpful? Give feedback.
Not sure if this is what you are looking for, we do not use AppThemebinding at all we have many themes if you like
when a user switches theme we remove the current theme(ResourceDictionary) and we load the selected theme (another resource dictionary)
so the approached used here is that given a set of themes the user chooses a theme and the app changes the color scheme . and we have some pages where we bind a color to a control and the user can change the color too but always bound to a resource dictionary where the colors are defined