使用 window theme
时间:2011-05-18 来源:zip's
.Net 提供了几种现成的 theme 可供使用
Classic
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/PresentationFramework.Classic;component/themes/Classic.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<StackPanel>
<StackPanel.Resources>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}">
<Setter Property="Width" Value="76"/>
<Setter Property="Height" Value="Auto"/>
</Style>
<Style TargetType="{x:Type RepeatButton}" BasedOn="{StaticResource {x:Type RepeatButton}}">
<Setter Property="Width" Value="12"/>
<Setter Property="Margin" Value="1,0,0,0"/>
</Style>
</StackPanel.Resources>
<StackPanel Orientation="Horizontal">
<RepeatButton Content="<"/>
<RepeatButton Content=">"/>
</StackPanel>
<Button Content="Click Me"/>
<RadioButton Content="Check Me"/>
<ComboBox>
<ComboBoxItem Content="ABC"/>
<ComboBoxItem Content="123"/>
<ComboBoxItem Content="*%#"/>
</ComboBox>
</StackPanel>
Aero
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
Luna
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!--<ResourceDictionary Source="/PresentationFramework.Luna;component/themes/Luna.NormalColor.xaml"/>-->
<!--<ResourceDictionary Source="/PresentationFramework.Luna;component/themes/Luna.Metallic.xaml"/>-->
<ResourceDictionary Source="/PresentationFramework.Luna;component/themes/Luna.HomeStead.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
Royale
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/PresentationFramework.Royale;component/themes/Royale.NormalColor.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
Reference Reading: MSDN, .NET3.5
to be continued ...
相关阅读 更多 +
排行榜 更多 +