【发布时间】:2011-01-23 12:56:28
【问题描述】:
我正在 WinXP 上编写一个 WPF 应用程序,我已经用 vista 主题覆盖了默认主题,如下所示:
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
var themerd = new ResourceDictionary();
themerd.Source = new Uri(@"PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component\themes/aero.normalcolor.xaml", UriKind.Relative);
Resources.MergedDictionaries.Add(themerd);
}
而且大部分情况下都可以正常工作。当我使用按钮等控件时:
<Button />
样式看起来不错,但是如果我使用具有不同样式的按钮,如下所示:
<Button>
<Button.Style>
<Style TargetType="Button">
<Setter Property="Width" Value="80" />
</Style>
</Button.Style>
</Button>
该样式将使用标准 WinXP 样式覆盖指定的主题样式,而不是在其之上构建。这对我来说非常有限。有没有办法避免这个问题?
【问题讨论】:
标签: wpf