0
我想通過把這個在我的App.xaml爲爲多個控制派生類型全局樣式:WPF-爲什麼這些樣式不工作?
<Style TargetType="{x:Type Control}">
<Setter Property="Background" Value="{Binding BackgroundBrush, Source={x:Static m:Settings.Instance}, UpdateSourceTrigger=PropertyChanged}" />
<Setter Property="Foreground" Value="{Binding ForegroundBrush, Source={x:Static m:Settings.Instance}, UpdateSourceTrigger=PropertyChanged}" />
<Setter Property="BorderBrush" Value="{Binding ForegroundBrush, Source={x:Static m:Settings.Instance}, UpdateSourceTrigger=PropertyChanged}" />
<Setter Property="UseLayoutRounding" Value="True" />
</Style>
<Style TargetType="{x:Type Window}" BasedOn="{StaticResource {x:Type Control}}" />
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Control}}" />
眼下窗口風格只適用於Visual Studio的設計窗口和按鈕樣式沒有按」根本不工作。我做錯了什麼?
您正在使用什麼版本的Visual Studio和.NET Framework?我在使用.NET 4.0(WPF 4.0)時遇到問題。見http://stackoverflow.com/questions/4239714/why-cant-i-style-a-control-with-the-aero-theme-applied-in-wpf-4-0。 – devuxer 2010-11-28 20:15:08