WPF模拟迅雷TabControl界面

点击查看下载

<!--TabControl样式-->
<Style x:Key="TabControlStyle" TargetType="{x:Type TabControl}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="Padding" Value="4,4,4,4"/>
<Setter Property="BorderThickness" Value=""/>
<Setter Property="BorderBrush" Value="{StaticResource TabControlNormalBorderBrush}"/>
<Setter Property="Background" Value="#F9F9F9"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="ColumnDefinition0" Width="0.192*" />
<ColumnDefinition x:Name="ColumnDefinition1" Width="0.808*"/>
</Grid.ColumnDefinitions>
<Border x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="" KeyboardNavigation.TabIndex="" KeyboardNavigation.TabNavigation="Local" Grid.ColumnSpan="" Grid.RowSpan="" Width="Auto" Margin="">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Width="Auto" Margin=""/>
</Border>
<StackPanel x:Name="HeaderPanel" Margin="" IsItemsHost="True">
<StackPanel.Background>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#7AFFFFFF" Offset=""/>
<GradientStop Color="#42F0FCFF" Offset=""/>
</LinearGradientBrush>
</StackPanel.Background>
</StackPanel>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="listTabItemStyle" TargetType="{x:Type TabItem}">
<Setter Property="FocusVisualStyle" Value="{StaticResource TabItemFocusVisual}"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="Padding" Value="6,1,6,1"/>
<Setter Property="BorderBrush" Value="{StaticResource TabControlNormalBorderBrush}"/>
<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid SnapsToDevicePixels="true" Margin="">
<Border x:Name="Bd" BorderThickness="" Background="{x:Null}">
<TextBlock x:Name="textBlock" HorizontalAlignment="Stretch" Margin="58.75,0,0,0" TextWrapping="Wrap" VerticalAlignment="Center" Text="{TemplateBinding Header}"/>
</Border>
<Path x:Name="path" Data="M87.399999,0 L174.8,44.596669 L-5.0876247E-07,44.596669 z" Fill="White" Height="Auto" Margin="0,9.667,-1.583,9.667" Stretch="Fill" StrokeThickness="" Width="11.466" RenderTransformOrigin="0.5,0.5" VerticalAlignment="Stretch" HorizontalAlignment="Right" Visibility="Hidden">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform Angle="-90"/>
<TranslateTransform/>
</TransformGroup>
</Path.RenderTransform>
</Path>
<Rectangle x:Name="rectangle" Margin="27,2.25,0,2.75" StrokeThickness="" HorizontalAlignment="Left" Width="22.25" Fill="{TemplateBinding Background}"/>
</Grid>
<ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="Selector.IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter
Property="CornerRadius" TargetName="Bd" Value=""/>
<Setter
Property="BorderBrush" TargetName="Bd" Value="#562C94AF"/>
<Setter
Property="Margin" TargetName="Bd" Value=""/>
<Setter
Property="BorderThickness" TargetName="Bd" Value=""/>
<Setter
Property="Background" TargetName="Bd">
<Setter.Value
>
<LinearGradientBrush
EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop
Color="#2690D9FF" Offset=""/>
<GradientStop
Color="#47FFFFFF" Offset=""/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
</MultiTrigger>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Panel.ZIndex" Value=""/>
<Setter Property="Background" TargetName="Bd">
<Setter.Value>
<RadialGradientBrush RadiusX="0.641" RadiusY="1.243">
<GradientStop Color="#FF6D9EC4" Offset=""/>
<GradientStop Color="#FFD4E0EB" Offset=""/>
</RadialGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Visibility" TargetName="path" Value="Visible"/>
<Setter Property="Foreground" TargetName="textBlock" Value="White"/>
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="Bd" Value="{StaticResource TabItemDisabledBackground}"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource TabItemDisabledBorderBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

转载:http://blog.csdn.net/cmis7645/article/details/7566813

最新文章

  1. 【JQ基础】
  2. ubuntu16.04 + ubuntu + apache2 配置apache解析php
  3. org.hibernate.NonUniqueObjectException: a different object with the same identifier value was alread---------程序报错
  4. IOS设计模式浅析之简单工厂模式(SimpleFactory)
  5. MFC Grid control 2.27
  6. caller 属性和callee属性
  7. MvvmCross for WPF 支持子窗体显示、关闭、传参
  8. log4net--帮助程序员将日志信息输出到各种目标(控制台、文件、数据库等)的工具
  9. delphi获取mdb密码
  10. FPGA在其他领域的应用(三)
  11. greenplum在执行vacuum和insert产生死锁问题定位及解决方案
  12. 如何用css写打印样式
  13. MySQL_列值为null对索引的影响_实践
  14. 11.Django2.0文档
  15. [luogu3810][bzoj3262]陌下花开【cdq分治】
  16. 使用jedis客户端连接redis,单机版和集群版
  17. PHP生成二维码并上传到七牛云
  18. spring -mvc service层调用工具类配置
  19. sqlmap自动注入
  20. last命令详解

热门文章

  1. c++ 指定目录下的文件遍历
  2. PAT Basic 1001 害死人不偿命的(3n+1)猜想 (15 分)
  3. 求二叉搜索树的第k小的节点
  4. Mysql数据类型 来自官方手册5.6
  5. sql语言积累
  6. 手动解析网易云音乐MP3真实地址
  7. i3wm
  8. dede cms 怎样调用年月日
  9. 用SWPM导入SAP时因用户Culture及系统Locale引发的问题
  10. win10 1903 更改文字大小