360 lines
20 KiB
XML
360 lines
20 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:Metro="clr-namespace:AduSkin.Controls.Metro;assembly=AduSkin">
|
|
<!--#region 设置窗口布局样式-->
|
|
<SolidColorBrush x:Key="DefaultBorderBrush" Color="#424346" />
|
|
<SolidColorBrush x:Key="ComboBoxBrush" Color="#6a6a6a"></SolidColorBrush>
|
|
<SolidColorBrush x:Key="Item.SelectedActive.foreground" Color="#396cd2" />
|
|
<SolidColorBrush x:Key="Item.MouseOver.Border" Color="#a826A0Da" />
|
|
|
|
<!-- ScrollViewer 滚动条 -->
|
|
<Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
|
<Setter Property="IsTabStop" Value="false"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Thumb}">
|
|
<Grid>
|
|
<!--滚动条颜色-->
|
|
<Border Background="#646465" CornerRadius="3"/>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="HorizontalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Focusable" Value="false"/>
|
|
<Setter Property="IsTabStop" Value="false"/>
|
|
<Setter Property="Opacity" Value="0.2"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
|
<Rectangle Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="VerticalScrollBarPageButton" TargetType="{x:Type RepeatButton}">
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Focusable" Value="false"/>
|
|
<Setter Property="IsTabStop" Value="false"/>
|
|
<Setter Property="Opacity" Value="0.2"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
|
<Rectangle Fill="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!--滚动条上下按钮-->
|
|
<Style x:Key="VerticalScrollBarPageButton2" TargetType="{x:Type RepeatButton}">
|
|
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Focusable" Value="false"/>
|
|
<Setter Property="IsTabStop" Value="false"/>
|
|
<Setter Property="Opacity" Value="0"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
|
<Rectangle Fill="#90000000" Width="0" Height="0"/>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<Style x:Key="for_scrollbar" TargetType="{x:Type ScrollBar}">
|
|
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
|
|
<Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Margin" Value="0,1,1,6"/>
|
|
<Setter Property="Width" Value="10"/>
|
|
<Setter Property="MinWidth" Value="5"/>
|
|
<Setter Property="Opacity" Value="0.2"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ScrollBar}">
|
|
<Grid x:Name="Bg" SnapsToDevicePixels="true">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto"></RowDefinition>
|
|
<RowDefinition Height="*"></RowDefinition>
|
|
<RowDefinition Height="auto"></RowDefinition>
|
|
</Grid.RowDefinitions>
|
|
<RepeatButton Grid.Row="0" Style="{StaticResource VerticalScrollBarPageButton2}" Command="{x:Static ScrollBar.PageUpCommand}"/>
|
|
<Track x:Name="PART_Track" Grid.Row="1" IsEnabled="{TemplateBinding IsMouseOver}" IsDirectionReversed="true">
|
|
<Track.DecreaseRepeatButton>
|
|
<RepeatButton Style="{StaticResource VerticalScrollBarPageButton}" Command="{x:Static ScrollBar.PageUpCommand}"/>
|
|
</Track.DecreaseRepeatButton>
|
|
<Track.IncreaseRepeatButton>
|
|
<RepeatButton Style="{StaticResource VerticalScrollBarPageButton}" Command="{x:Static ScrollBar.PageDownCommand}"/>
|
|
</Track.IncreaseRepeatButton>
|
|
<Track.Thumb>
|
|
<Thumb Style="{StaticResource ScrollBarThumb}"/>
|
|
</Track.Thumb>
|
|
</Track>
|
|
<RepeatButton Grid.Row="2" Style="{StaticResource VerticalScrollBarPageButton2}" Command="{x:Static ScrollBar.PageDownCommand}"/>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
<Style.Triggers>
|
|
<Trigger Property="Orientation" Value="Horizontal">
|
|
<Setter Property="Background" Value="Transparent"/>
|
|
<Setter Property="Margin" Value="1,0,6,1"/>
|
|
<Setter Property="Height" Value="5"/>
|
|
<Setter Property="MinHeight" Value="5"/>
|
|
<Setter Property="Width" Value="Auto"/>
|
|
<Setter Property="Opacity" Value="0.2"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ScrollBar}">
|
|
<Grid x:Name="Bg" SnapsToDevicePixels="true">
|
|
<Track x:Name="PART_Track" IsEnabled="{TemplateBinding IsMouseOver}">
|
|
<Track.DecreaseRepeatButton>
|
|
<RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}" Command="{x:Static ScrollBar.PageLeftCommand}"/>
|
|
</Track.DecreaseRepeatButton>
|
|
<Track.IncreaseRepeatButton>
|
|
<RepeatButton Style="{StaticResource HorizontalScrollBarPageButton}" Command="{x:Static ScrollBar.PageRightCommand}"/>
|
|
</Track.IncreaseRepeatButton>
|
|
<Track.Thumb>
|
|
<Thumb Style="{StaticResource ScrollBarThumb}"/>
|
|
</Track.Thumb>
|
|
</Track>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
<Style x:Key="for_scrollviewer"
|
|
TargetType="{x:Type ScrollViewer}">
|
|
<Setter Property="BorderBrush" Value="LightGray"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
|
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
|
|
<Grid Background="{TemplateBinding Background}">
|
|
<ScrollContentPresenter Cursor="{TemplateBinding Cursor}" Margin="{TemplateBinding Padding}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
|
|
<ScrollBar x:Name="PART_VerticalScrollBar"
|
|
HorizontalAlignment="Right"
|
|
Maximum="{TemplateBinding ScrollableHeight}"
|
|
Orientation="Vertical"
|
|
Style="{StaticResource for_scrollbar}"
|
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
|
Value="{TemplateBinding VerticalOffset}"
|
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
|
|
<ScrollBar x:Name="PART_HorizontalScrollBar"
|
|
Maximum="{TemplateBinding ScrollableWidth}"
|
|
Orientation="Horizontal"
|
|
Style="{StaticResource for_scrollbar}"
|
|
VerticalAlignment="Bottom"
|
|
Value="{TemplateBinding HorizontalOffset}"
|
|
ViewportSize="{TemplateBinding ViewportWidth}"
|
|
Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
|
|
</Grid>
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<EventTrigger RoutedEvent="ScrollChanged" >
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="PART_VerticalScrollBar"
|
|
Storyboard.TargetProperty="Opacity"
|
|
To="0.8"
|
|
Duration="0:0:1"/>
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="PART_VerticalScrollBar"
|
|
Storyboard.TargetProperty="Opacity"
|
|
To="0.2"
|
|
Duration="0:0:1"
|
|
BeginTime="0:0:1"/>
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="PART_HorizontalScrollBar"
|
|
Storyboard.TargetProperty="Opacity"
|
|
To="0.8"
|
|
Duration="0:0:1"/>
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="PART_HorizontalScrollBar"
|
|
Storyboard.TargetProperty="Opacity"
|
|
To="0.2"
|
|
Duration="0:0:1"
|
|
BeginTime="0:0:1"/>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
<EventTrigger RoutedEvent="MouseEnter"
|
|
SourceName="PART_VerticalScrollBar">
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="PART_VerticalScrollBar"
|
|
Storyboard.TargetProperty="Opacity"
|
|
To="0.8"
|
|
Duration="0:0:0.7"/>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
<EventTrigger RoutedEvent="MouseLeave"
|
|
SourceName="PART_VerticalScrollBar">
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="PART_VerticalScrollBar"
|
|
Storyboard.TargetProperty="Opacity"
|
|
To="0.2"
|
|
Duration="0:0:0.7"/>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
<EventTrigger RoutedEvent="MouseEnter"
|
|
SourceName="PART_HorizontalScrollBar">
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="PART_HorizontalScrollBar"
|
|
Storyboard.TargetProperty="Opacity"
|
|
To="0.8"
|
|
Duration="0:0:0.7"/>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
<EventTrigger RoutedEvent="MouseLeave"
|
|
SourceName="PART_HorizontalScrollBar">
|
|
<BeginStoryboard>
|
|
<Storyboard>
|
|
<DoubleAnimation
|
|
Storyboard.TargetName="PART_HorizontalScrollBar"
|
|
Storyboard.TargetProperty="Opacity"
|
|
To="0.2"
|
|
Duration="0:0:0.7"/>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<!--默认ScrollBar-->
|
|
<Style x:Key="CusScrollBar" TargetType="ScrollBar" BasedOn="{StaticResource for_scrollbar}"/>
|
|
|
|
<!--默认ScrollView-->
|
|
<Style x:Key="CusScroll" TargetType="ScrollViewer" BasedOn="{StaticResource for_scrollviewer}"/>
|
|
|
|
<Style x:Key="LeftIndicatorStyle" TargetType="{x:Type Metro:SegmentControl}">
|
|
<Setter Property="Padding" Value="0" />
|
|
<Setter Property="CornerRadius" Value="0" />
|
|
<Setter Property="VerticalAlignment" Value="Top" />
|
|
<Setter Property="BorderThickness" Value="0,0,0,0" />
|
|
<Setter Property="BorderBrush" Value="Transparent" />
|
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
|
<Setter Property="Background" Value="#2a2b30" />
|
|
<Setter Property="Foreground" Value="#ffffff" />
|
|
<Setter Property="ItemsPanel">
|
|
<Setter.Value>
|
|
<ItemsPanelTemplate>
|
|
<StackPanel Orientation="Vertical" IsItemsHost="True" />
|
|
</ItemsPanelTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style x:Key="LeftIndicatorItemStyle" TargetType="{x:Type Metro:SegmentItem}">
|
|
<Setter Property="Padding" Value="0" />
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Right" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type Metro:SegmentItem}">
|
|
<Border x:Name="Bd"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
Padding="{TemplateBinding Padding}"
|
|
SnapsToDevicePixels="true" UseLayoutRounding="True">
|
|
<ContentPresenter Margin="20,8,20,8"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<!--<Setter TargetName="Bd" Property="Background" Value="{StaticResource Item.MouseOver.Background}" />-->
|
|
<Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource Item.MouseOver.Border}" />
|
|
</Trigger>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="IsMouseOver" Value="True" />
|
|
<Condition Property="IsSelected" Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<!--<Setter TargetName="Bd" Property="Background" Value="{StaticResource Item.MouseOver.Background}" />-->
|
|
<Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource Item.MouseOver.Border}" />
|
|
</MultiTrigger>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="Selector.IsSelectionActive" Value="False" />
|
|
<Condition Property="IsSelected" Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter TargetName="Bd" Property="Background" Value="#232428" />
|
|
<Setter Property="Foreground" Value="{StaticResource Item.SelectedActive.foreground}" />
|
|
</MultiTrigger>
|
|
<MultiTrigger>
|
|
<MultiTrigger.Conditions>
|
|
<Condition Property="Selector.IsSelectionActive" Value="True" />
|
|
<Condition Property="IsSelected" Value="True" />
|
|
</MultiTrigger.Conditions>
|
|
<Setter TargetName="Bd" Property="Background" Value="#232428" />
|
|
<Setter Property="Foreground" Value="{StaticResource Item.SelectedActive.foreground}" />
|
|
</MultiTrigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
<!--#endregion-->
|
|
|
|
<!--设置窗口属性行样式-->
|
|
<Style TargetType="DockPanel" x:Key="SettingItem">
|
|
<Setter Property="Height" Value="35"></Setter>
|
|
<Setter Property="Margin" Value="10"></Setter>
|
|
<Setter Property="VerticalAlignment" Value="Top"></Setter>
|
|
</Style>
|
|
<!--设置窗口属性行标题-->
|
|
<Style TargetType="TextBlock" x:Key="SettingItemText">
|
|
<Setter Property="Foreground" Value="White"></Setter>
|
|
<Setter Property="HorizontalAlignment" Value="Left"></Setter>
|
|
<Setter Property="VerticalAlignment" Value="Center"></Setter>
|
|
<Setter Property="Width" Value="135"></Setter>
|
|
<Setter Property="TextAlignment" Value="Left"></Setter>
|
|
</Style>
|
|
|
|
<!--图标按钮-->
|
|
<Style TargetType="Button" x:Key="CusIconBtn">
|
|
<Setter Property="Cursor" Value="Hand" />
|
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="Button">
|
|
<Border Name="border" BorderThickness="0" BorderBrush="Black">
|
|
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
|
|
</Border>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter Property="Opacity" Value="0.8" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ResourceDictionary> |