madskristensen / Community.VisualStudio.Toolkit

A community toolkit for writing Visual Studio extensions
Other
24 stars 3 forks source link

WPF Theming #9

Closed reduckted closed 3 years ago

reduckted commented 3 years ago

First of all, thanks for this library @madskristensen! I think it's going to be a great asset for extension authors. Now, onto the issue.

It would be great to have your VSTheme helper class that applies the current Visual Studio theme to dialogs and other controls as part of this library.

I'm not sure if these are a new addition to the Visual Studio SDK, but I've recently used ThemedDialogStyleLoader.UseDefaultThemedDialogStyles and ImageThemingUtilities.ThemeScrollBars to style a dialog. Perhaps they supersede part or all of the VSTheme helpers, or maybe they are complimentary?

yannduran commented 3 years ago

This is just a question, not a criticism or anything. I'm not saying that these helpers shouldn't be included in the NuGet package, I'm just wondering why anyone would need either of the approaches that you mentioned?

To date, I've done all of my control styling using just XAML, and haven't found a need for VSTheme. I thought maybe it was just a legacy way of theming prior to MS providing the VsColors/VsBrushes XAML resources for us to use.

Perhaps @madskristensen, could you comment on this?

reduckted commented 3 years ago

As far as I understand, the benefit of VsTheme is that it does it all the work for you. You don't have to individually set the styles or individual colors of controls. You just set the attached property on the root DialogWindow or UserControl and it sets the styles for you.

To sort of answer my own question about those additional attached properties, this is the difference (themes from left to right are Light, Blue and Dark):

Standard Dialog: Standard

Using only ImageThemingUtilities.ThemeScrollBars: With-ImageThemingUtilities

Using only ThemedDialogStyleLoader.UseDefaultThemedDialogStyles: With-ThemedDialogStyleLoader

Using only VsTheme: With-VsTheme

madskristensen commented 3 years ago

It's a good idea. We need documentation for how to use it and it should be added to the Extensibility Template Pack's tool window template

yannduran commented 3 years ago

@reduckted thanks for the explanation :-)