My first and only foray into WPF was to write a Visual Studio Extension for JIRA, and one of the very first user request was to support theming. I tried to use the resources that Visual Studio exposes to change the brushes dynamically but I found the documentation so poor and the experience of having to dissect dozens and dozens of brushes and colors a turn off.
Instead I looked at libraries that already defined themes for the core controls that I used. This led me to MahApps.Metro, a toolkit for WPF that has multiple themes. I just dropped this in, wrote some code to manage and store the theme selector and most of the color in the UI was handled for me. This is how the extension looks within the Visual Studio shell:


There were minor tweaks needed and I could use the style names directly by searching them in the github repo. I don’t know if there was a simpler way, but for my needs this was easy enough.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.