在哪里可以获得类似于 Visual Studio 2010 界面的 WPF 控件的主题? [英] Where can I get themes for WPF controls that resemble the Visual Studio 2010 interface?

查看:23
本文介绍了在哪里可以获得类似于 Visual Studio 2010 界面的 WPF 控件的主题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序是围绕 AvalonDock 构建的,它具有非常好的 Visual Studio 2010 外观(比所有其他外观漂亮得多).现在我想为我的应用程序的其余部分设置样式以配合它.我对以下部分最感兴趣:

  • 工具栏 - 我主要是靠自己设法获得正确的颜色,但 VS 工具栏仍然更漂亮.
  • (Context)Menu - VS 将蓝色菜单项焦点框替换为漂亮的橙色焦点框,使应用程序感觉更温暖、更友好.
  • 主窗口背景 - 这是 AD 没有做对的一件事.

网络上有这些样式吗?或者它们可以从 VS 中提取出来吗?

感谢您的帮助.

解决方案

当我有同样的目的时,我使用了 Reflector(与 是带有 VS2010 外观的 TabControl我之前实施过.它没有相同的功能,但看起来相同.

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.

解决方案

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.

这篇关于在哪里可以获得类似于 Visual Studio 2010 界面的 WPF 控件的主题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆