WPF 模拟迅雷TabControl界面

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="1"/>
		<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="1" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="0" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local" Grid.ColumnSpan="1" Grid.RowSpan="1" Width="Auto" Margin="0">
							<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Width="Auto" Margin="0"/>
						</Border>
						<StackPanel x:Name="HeaderPanel" Margin="0" IsItemsHost="True">
							<StackPanel.Background>
								<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
									<GradientStop Color="#7AFFFFFF" Offset="0"/>
									<GradientStop Color="#42F0FCFF" Offset="1"/>
								</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="0">
						<Border x:Name="Bd" BorderThickness="0" 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="0" 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="0" 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="3"/>
							<Setter
						Property="BorderBrush" TargetName="Bd" Value="#562C94AF"/>
							<Setter
						Property="Margin" TargetName="Bd" Value="1"/>
							<Setter
						Property="BorderThickness" TargetName="Bd" Value="1"/>
							<Setter
						Property="Background" TargetName="Bd">
								<Setter.Value
						>
									<LinearGradientBrush
						EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop
						Color="#2690D9FF" Offset="1"/>
										<GradientStop
						Color="#47FFFFFF" Offset="0"/>
									</LinearGradientBrush>
								</Setter.Value>
							</Setter>
						</MultiTrigger>
						<Trigger Property="IsSelected" Value="true">
							<Setter Property="Panel.ZIndex" Value="1"/>
							<Setter Property="Background" TargetName="Bd">
								<Setter.Value>
									<RadialGradientBrush RadiusX="0.641" RadiusY="1.243">
										<GradientStop Color="#FF6D9EC4" Offset="1"/>
										<GradientStop Color="#FFD4E0EB" Offset="0"/>
									</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>


  • 1
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值