Suppose in my WPF program, I have created an option for the user to change the application theme (dark and light). What if I want to change all of the icons based on the selected theme? What's the best approach to do this?
Asked
Active
Viewed 274 times
0
-
Put all your images in a resourcedictionary and swap that upon theme change. Reference your images using `{DynamicResource}` throughout the UI. – Federico Berasategui Dec 24 '14 at 22:32
-
@HighCore Could you make that to an answer and elaborate just a little more? Thanks. – Alireza Noori Dec 24 '14 at 23:03
-
Can you provide some example perhaps ?. Your question is a bit unclear to me – Osman Esen Dec 25 '14 at 01:12
-
@OsmanEsen Suppose I have an application with bunch of forms, dialog, etc. There may be some icons used for menus, buttons... When I change the theme of the application I want to change the icons accordingly. For instance light icons for dark theme and dark icons for light theme. – Alireza Noori Dec 25 '14 at 01:16