【.Net码农】WPF界面设计—撸大师

来源:互联网 发布:淘宝一键好复制怎么用 编辑:程序博客网 时间:2024/04/30 01:53

http://blog.csdn.net/cmis7645/article/details/7562833



WPF界面设计,模仿了金山卫士,360,鲁大师的界面!


[html] view plaincopy
  1.     <!--无边框窗体-->  
  2.     <Style x:Key="NoResize_window" TargetType="{x:Type Window}">    
  3.     <Setter Property="AllowsTransparency" Value="true"/>    
  4.     <Setter Property="Background" Value="Transparent"/>    
  5.     <Setter Property="FontFamily" Value="Consolas, Microsoft YaHei"/>    
  6.     <Setter Property="FontSize" Value="24"/>    
  7.     <Setter Property="ResizeMode" Value="NoResize"/>    
  8.     <Setter Property="WindowStyle" Value="None"/>    
  9.     <Setter Property="Template">    
  10.         <Setter.Value>    
  11.             <ControlTemplate TargetType="{x:Type Window}">    
  12.                 <Grid Margin="10">    
  13.                     <Rectangle Fill="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"    
  14.                         RadiusX="3" RadiusY="3">    
  15.                         <Rectangle.Effect>    
  16.                             <DropShadowEffect BlurRadius="10" ShadowDepth="0" Color="#FF898989"/>    
  17.                         </Rectangle.Effect>    
  18.                     </Rectangle>    
  19.                     <Border Background="{TemplateBinding Background}"    
  20.                         BorderBrush="{TemplateBinding BorderBrush}"    
  21.                         BorderThickness="{TemplateBinding BorderThickness}"    
  22.                         Padding="{TemplateBinding Margin}"    
  23.                         SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"    
  24.                         CornerRadius="3">    
  25.                         <ContentPresenter />    
  26.                     </Border>    
  27.                 </Grid>    
  28.             </ControlTemplate>    
  29.         </Setter.Value>    
  30.     </Setter>    
  31. </Style>    

[html] view plaincopy
  1. <!--TabControl样式资源-->  
  2. <Style x:Key="TabControlStyle" TargetType="{x:Type TabControl}">  
  3.     <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>  
  4.     <Setter Property="Padding" Value="4,4,4,4"/>  
  5.     <Setter Property="BorderThickness" Value="1"/>  
  6.     <Setter Property="BorderBrush" Value="#8C8E94"/>  
  7.     <Setter Property="Background" Value="#F9F9F9"/>  
  8.     <Setter Property="HorizontalContentAlignment" Value="Center"/>  
  9.     <Setter Property="VerticalContentAlignment" Value="Center"/>  
  10.     <Setter Property="Template">  
  11.         <Setter.Value>  
  12.             <ControlTemplate TargetType="{x:Type TabControl}">  
  13.                 <Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">  
  14.                     <Grid.RowDefinitions>  
  15.                         <RowDefinition x:Name="RowDefinition0" Height="Auto" MinHeight="102.5"/>  
  16.                         <RowDefinition x:Name="RowDefinition1"/>  
  17.                     </Grid.RowDefinitions>  
  18.                     <Border x:Name="ContentPanel" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">  
  19.                         <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>  
  20.                     </Border>  
  21.                     <Canvas x:Name="HeaderPanel" HorizontalAlignment="Stretch" Height="Auto" VerticalAlignment="Stretch" Width="Auto" IsItemsHost="True"/>  
  22.                 </Grid>  
  23.             </ControlTemplate>  
  24.         </Setter.Value>  
  25.     </Setter>  
  26. </Style>  
0 0
原创粉丝点击