【发布时间】:2011-01-05 18:03:00
【问题描述】:
有没有什么方法可以让 WPF 应用看起来像是在 Windows 7 上运行,即使它是在 XP 上运行的?我正在寻找可以粘贴的某种主题。我知道 Codeplex 上的主题项目 (https://archive.codeplex.com/?p=wpfthemes),但它缺乏对 DataGrid 的支持,这是我非常需要的。我在想也许 Windows 7 主题只是一个简单的移植,或者已经存在于某个文件中。
更新
使用@Lars Truijens 的想法,我能够让 Windows 7 查找主要控件,但不幸的是它不适用于我需要的 WPF Toolkit DataGrid 控件。
DataGrid 在 Aero 主题下看起来像这样
DataGrid应该看起来像这样
因此,如果有人有任何想法,我仍在寻找解决此问题的方法。也许有人构建了涵盖 WPF 工具包控件的 Aero 主题的扩展?再次感谢您提供的任何信息。
更新 2 - DataGrid 问题已解决!
要使 Aero 主题与 DataGrid 或任何其他 WPF Toolkit 控件一起使用,您只需添加第二个 Aero 字典,因此您的 App.xaml 现在应该如下所示。
<Application.Resources>
...
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary
Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml" />
<ResourceDictionary
Source="pack://application:,,,/WPFToolkit;component/Themes/Aero.NormalColor.xaml" />
...
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
另外,我建议关闭 DataGrid 控件中的网格线(因为它们看起来可怕):
<DataGrid GridLinesVisibility="None" ...>
【问题讨论】:
-
你的更新 2 救了我的命!!!感谢您发布更新!
标签: .net wpf windows themes wpftoolkit