Where can I get themes for WPF controls that resemble the Visual Studio 2010 interface?
Asked Answered
H

1

8

My application is build around AvalonDock, which has quite good Visual Studio 2010 skin (which is much prettier than all the other skins). Now I would like to style the rest of my application to go with it. I'm interested most in following parts:

  • Toolbar - I mostly managed to get the colors right on my own, but the VS toolbars are still prettier.
  • (Context)Menu - VS has the blue menu item focus box replaced with a nice orange one, which gives the application much warmer and friendlier feel.
  • Main window background - this is one thing which AD didn't get right.

Are these styles somewhere on the web? Or can they be somehow extracted from the VS?

Thanks for any help.

Hydrogenolysis answered 30/1, 2011 at 11:54 Comment(0)
D
13

When I had the same purpose, I used Reflector (with BAML Viewer Add-in) and this color editor

The styles and templates of the VS controls are located at the path (Path of VS2010)\Common7\IDE\en\. Necessary file is Microsoft.VisualStudio.Shell.UI.Internal.resources.dll

If to expand this library in BAML Viewer, there will be many files, but the most useful are listed in the file themes/generic.xaml.

They are:

  • Styles/MainWindowStyle.xaml - mark-up of the main window.
  • Styles/CommandMenuStyle.xaml - styles of the menu, the toolbar, the combobox.
  • Styles/StandardContextMenuStyle.xaml - style of the context menu.

For example, if you open MainWindowsStyle.xaml, you will find this code:

<Setter x:Uid="Setter_26" Property="Background" Value="{DynamicResource {x:Static EnvironmentBackgroundGradientKey}}" />

Now install VS Color theme editor, in Visual Studio open Theme -> Customize Colors -> Default. enter image description here The key EnvironmentBackgroundGradient has 4 items in the list. It can be written in the following way:

<LinearGradientBrush x:Key="EnvironmentBackgroundGradient" StartPoint="0.5,0" EndPoint="0.5,1">
    <GradientStop Color="#293955"/>
    <GradientStop Color="#35496a" Offset="0.5"/>
    <GradientStop Color="#35496a" Offset="0.5"/>
    <GradientStop Color="#293955" Offset="1"/>
</LinearGradientBrush>

Probably, these colors are explained somewhere in detail, but I haven't found this, so I used Reflector.

Another assemblies that can be useful:

  • en\Microsoft.VisualStudio.Platform.WindowManagement.resources.dll - styles of the TabControl and DockManager
  • PrivateAssemblies\Microsoft.VisualStudio.ExtensionsExplorer.UI.dll - selection of a new project

And here is TabControl with VS2010 look that I've implemented earlier. It doesn't have the same functionality, but it looks the same.

Dorella answered 30/1, 2011 at 18:2 Comment(5)
And where can I find definition of the EnvironmentBackgroundGradientKey brush? It is not the linear brush, because I think it should be the dark dotted texture that is the background of the VS window.Unmeriting
The dots is a tricky brush that is called EnvironmentBackgroundTexture. I don't know how it is created, it seems to be a DrawingBrush with a pattern like the 5 on the dice.Dorella
Where can I find the Microsoft.VisualStudio.ExtensionsExplorer.UI.dll?Restrainer
@Restrainer `c:\Program Files\Microsoft Visual Studio\Common7\IDE\PrivateAssemblies`. Also they can be easily found by using the Search menu of the Window Explorer.Dorella
@vorrtex You try that on my Win7, it sucks. I took an hour searching my whole computer and brought nothing even though file was there. I think it only brings results that were indexed. WeirdRestrainer

© 2022 - 2024 — McMap. All rights reserved.