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

孤街浪徒 提交于 2019-11-28 20:55:33
vortexwolf

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!