是否有任何方法可以使WPF应用看起来像在Windows 7上运行,即使它在XP上运行?我正在寻找一些我可以粘贴的主题.我知道Codeplex上的主题项目(http://www.codeplex.com/wpfthemes),但它缺乏支持DataGrid,这是我批判性的需要.我想也许Windows 7主题可能只是一个简单的端口,或者已存在于某个文件中.您所拥有的任何信息(即使是坏消息)都将非常感激.
更新
使用@Lars Truijens的想法,我能够获得主要控件的Windows 7外观,但遗憾的是它不能用于DataGrid我需要的WPF Toolkit 控件.
DataGrid Aero主题看起来像这样

DataGrid 应该是这样的

所以,如果有人有任何想法,我仍然在寻找这个问题的解决方案.也许有人为Aero主题构建了一个扩展,涵盖了WPF工具包控件?同样,非常感谢您提供的任何信息.
更新2 - 问题解决了!
要使Aero主题与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>
Run Code Online (Sandbox Code Playgroud)
另外,我建议你在DataGrid控件中关闭网格线(因为它们看起来很糟糕):
<DataGrid GridLinesVisibility="None" ...>
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用SelectButton(https://gist.github.com/loraderon/580405),但我需要为它指定MinWidth.否则宽度只是Extender的宽度.删除ColumnSpan或设置第一列自动不是诀窍.我真的希望它总是具有list + extender符号中最宽元素的宽度.
<UserControl x:Class="loraderon.Controls.SelectButton"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:my="clr-namespace:loraderon.Controls"
mc:Ignorable="d"
SizeChanged="UserControl_SizeChanged"
d:DesignHeight="30" d:DesignWidth="100">
<Grid
x:Name="SplitGrid"
>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="23" />
</Grid.ColumnDefinitions>
<Button
x:Name="Button"
Click="Button_Click"
Grid.ColumnSpan="2"
Padding="0"
HorizontalContentAlignment="Left"
>
<ContentControl
x:Name="ButtonContent"
HorizontalContentAlignment="Center"
ContentTemplate="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:SelectButton}}, Path=ItemTemplate}"
/>
</Button>
<Expander
x:Name="Expander"
Expanded="Expander_Expanded"
Collapsed="Expander_Collapsed"
Grid.Column="1"
VerticalAlignment="Center"
IsExpanded="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:SelectButton}}, Path=IsExpanded}"
/>
<Popup
IsOpen="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:SelectButton}}, Path=IsExpanded}"
PlacementTarget="{Binding ElementName=Button}"
PopupAnimation="Fade"
StaysOpen="False"
>
<ListBox
x:Name="ListBox"
SelectionMode="Single"
SelectionChanged="ListBox_SelectionChanged"
SelectedIndex="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:SelectButton}}, Path=SelectedIndex, …Run Code Online (Sandbox Code Playgroud) 我找不到默认的WPF ControlTemplate的CheckBox。有谁知道如何找到它?我只能找到MSDN上的SilverLight默认复选框模板。
MSDN为WPF复选框示例提供了一个自定义控件模板,该模板使用X代替复选标记。我专门在寻找WPF随附的默认检查标记样式 -我只是无法为其找到XAML。
我也尝试过使用模板XamlWriter,但无济于事。从WPF控制模板示例中下载“简单样式”模板也仅使用X代替经典的复选标记。