I am creating a calculator in WPF and I want to do some themes like light-mode, green-mode and etc. I have menu with options to set theme, and when somebody clicks 'green-mode' the theme should change for green. I don't know how to start. I want to do it professionally so I think everything should be in XAML. I heard about <ResourceDictionary.ThemeDictionaries> and Material Design library. Do you have an idea how to start or what should I read about, any technologies?
CodePudding user response:
Theming is an extensive topic and there are many resources on this topic out there. Your question actually has two components: how to create a theme, and subsequently, how to have multiple themes and dynamically switch between them.
As for creating themes, I think your best bet would be to take a close look at other themes out there. A theme typically resides in one or more resource dictionaries. A quick search got me this:
- Where can i find some themes/demo for UI in WPF application?
- https://michaelscodingspot.com/wpf-complete-guide-themes-skins/
Then once you have your themes, add functionality to switch: