Maths revision can get pretty boring after a few hours, so I decided to have a little fun looking at View Extensions again. I’ve recently been learning all about WPF and MVVM – which is something like magic at first, then like eating a frozen lemon and then starts to make sense in drips and drabs – that’s my experience at least, your experience may differ.

Either way, while adding a little more features to my Python Snippet Locker I thought I would revisit the Group Colour Manager. This is something I did a while back, but always wanted to have it automatic rather than clicking a button. Thankfully, while on my explorations in WPF/MVVM I realised what the missing piece was –ย  PropertyChanged events, which are fundamental in MVVM.

So, here it is in action…

 

You may notice I got a little sidetracked (the Group Colour Manager didn’t take long) and I may have changed my Dynamo Theme just a tad… ๐Ÿ™‚

Again, WPF/MVVM related, I was looking for the Dynamo Theme colours in Dynamos GitHub repos. I found the UI/Themes/Modern repo which had exactly what I was looking for! Great Stuff! But, it also turns out this file is in the Dynamo Core folder too…even greater stuff!

You can see where I am going with this… Dynamo is just soooo grey (but it is sexy) and I couldn’t help myself.. ๐Ÿ˜€

C:\Program Files\Dynamo\Dynamo Core\1.3\UI\Themes\Modern

You probably shouldn’t be playing around with this file, but I saved a backup and I can always just reinstall or copy the text back from GitHub should it go nuts – responsible as I am.

This file resides in an Admin Only folder, meaning if you don’t have permissions, you can’t save the edits, meaning no pretty colours for you! But it’s really easy to do if you have Admin Rights to the file and they even recommend a good colour picker (I am naturally rebellious and went with my own favourite of course).

<!-- Node colors in inactive state -->
<SolidColorBrush x:Key="headerBackgroundInactive" Color="#95D9FF" />
<SolidColorBrush x:Key="headerForegroundInactive" Color="#898989" />
<SolidColorBrush x:Key="headerBorderInactive" Color="#004167" />
<SolidColorBrush x:Key="outerBorderInactive" Color="#004167" />
<SolidColorBrush x:Key="bodyBackgroundInactive" Color="#CBECFF" />

All you need to do is change the hex colour string (shown in magenta) to whatever you want. My favourite online colour picker I mentioned earlier gives you the hex value (the one that starts with # and followed by numbers/letters), you just copy and paste it in. It’s that simple!

Anyway, I spent way longer today looking at colour swatches than coding, redecorating is always hard work, but I think I have the Colours I want now and a good April Fools prank to look forward to where the everything is very nearly the same shade of grey.

Thanks for reading as always, and I’ll post the extension/code for the Group Colour Manager in a separate post I think.

Advertisement