Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

Naive question: why are my WPF Buttons and controls in my ToolWindow not themed in VS2012? Why are they still grey and ugly even though the ToolWindow has been themed?

$
0
0

I will ask these questions in the most naive way possible about themeing in VS2012 - because I am convinced there must be an easier way of doing this. 

Lets assume I am working in the Dark Theme; I create a brand new VSPackage in VS2012 (via the SDK). 

I add a Toolbar, a ListView and a Button to the UserControl.

When I start my VSPackage in Debug Mode, the ToolWindow background and ToolWindow borders etc are correctly themed according to the Visual Studio Theme - however, the Button, Toolbar and ListView on my User Control still look like the standard Window Shell buttons (big, grey, ugly).

1. Perhaps naively, but my understanding was that all the standard controls in the User Control would be automatically themed by Visual Studio. Is this correct?

2. Failing that, is there an API in VSX that will let me theme those buttons and toolbars like the toolbars in Visual Studio? I am aware of the VsBrushes and IVsUIShell5.GetWPFThemeColor methods but surely there is an easier way than rewriting the XAML Styles for each of the stock Windows controls and binding to those brushes and colors?!  

3. Or perhaps the Visual Studio XAML Styles for the controls can be referenced from my User Control as a resource dictionary? There doesn't seem to be anything obvious...

... except: I thought IVsUIShell5.ThemeWindow would work, but it always returns False and has no effect. 

4. Is IVsUIShell5.ThemeWindow the way to theme those ugly grey buttons? If so, when do I call it (my understanding is that the User Control in WPF is not rendered by GDI and therefore does not have a HWnd/Handle). Whenever I call it, for a dialog for example, and pass in, say, a Microsoft.VisualStudio.PlatformUI.DialogWindow().Handle that is non-null, the method just returns False.

5. I was expecting the themeing to "just work" out of the box. Am I wrong?

Any help and clarifications appreciated!

Grey Ham


Blog: http://www.havecomputerwillcode.com/blog


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>