整理代码
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:assists="clr-namespace:Melskin.Assists"
|
||||
xmlns:decorations="clr-namespace:Melskin.Controls.Decorations"
|
||||
xmlns:internal="clr-namespace:Melskin.Converters.Internal"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:internal="clr-namespace:Melskin.Converters.Internal">
|
||||
|
||||
<Style TargetType="ListBox" x:Key="SlideTabGroupListBoxStyle">
|
||||
<Style x:Key="SlideTabGroupListBoxStyle" TargetType="ListBox">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="assists:ControlAssist.CornerRadius" Value="4" />
|
||||
@@ -29,33 +29,33 @@
|
||||
<Grid Background="Transparent">
|
||||
<!-- 选中指示器 -->
|
||||
<decorations:SlotBorder
|
||||
x:Name="slot"
|
||||
Padding="-4"
|
||||
CornerRadius="{Binding Path=(assists:ControlAssist.CornerRadius), RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
|
||||
Intensity="0.2"
|
||||
Padding="-4"
|
||||
ShaderEnabled="False"
|
||||
Visibility="Collapsed"
|
||||
x:Name="slot" />
|
||||
Visibility="Collapsed" />
|
||||
<ContentPresenter
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<!-- 被选中时,仅改变文字颜色 -->
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter Property="ShaderEnabled" TargetName="slot" Value="True" />
|
||||
<Setter TargetName="slot" Property="ShaderEnabled" Value="True" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextDisabledBrush}" />
|
||||
</Trigger>
|
||||
<!-- 多选时,隐藏指示器 -->
|
||||
<DataTrigger Binding="{Binding Path=SelectionMode, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}" Value="Multiple">
|
||||
<Setter Property="Visibility" TargetName="slot" Value="Visible" />
|
||||
<Setter TargetName="slot" Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding Path=SelectionMode, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}" Value="Extend">
|
||||
<Setter Property="Visibility" TargetName="slot" Value="Visible" />
|
||||
<Setter TargetName="slot" Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -76,18 +76,18 @@
|
||||
<ControlTemplate TargetType="ListBox">
|
||||
<Grid>
|
||||
<decorations:EmbossBorder
|
||||
Margin="-4"
|
||||
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
||||
Intensity="0.8"
|
||||
Margin="-4" />
|
||||
Intensity="0.8" />
|
||||
<!-- Canvas 用于精确定位滑块 -->
|
||||
<Canvas x:Name="PART_SlideCanvas">
|
||||
<!-- 滑块元素,Name 是关键,行为代码通过它来查找并控制动画 -->
|
||||
<decorations:SlotBorder
|
||||
x:Name="PART_SelectionIndicator"
|
||||
Padding="-4"
|
||||
CornerRadius="{Binding Path=(assists:ControlAssist.CornerRadius), RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
|
||||
Intensity="0.2"
|
||||
Padding="-4"
|
||||
ShaderEnabled="True"
|
||||
x:Name="PART_SelectionIndicator">
|
||||
ShaderEnabled="True">
|
||||
<decorations:SlotBorder.RenderTransform>
|
||||
<TranslateTransform />
|
||||
</decorations:SlotBorder.RenderTransform>
|
||||
@@ -102,10 +102,10 @@
|
||||
</Trigger>
|
||||
<!-- 隐藏滑块 -->
|
||||
<Trigger Property="SelectionMode" Value="Multiple">
|
||||
<Setter Property="Visibility" TargetName="PART_SlideCanvas" Value="Collapsed" />
|
||||
<Setter TargetName="PART_SlideCanvas" Property="Visibility" Value="Collapsed" />
|
||||
</Trigger>
|
||||
<Trigger Property="SelectionMode" Value="Extended">
|
||||
<Setter Property="Visibility" TargetName="PART_SlideCanvas" Value="Collapsed" />
|
||||
<Setter TargetName="PART_SlideCanvas" Property="Visibility" Value="Collapsed" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -113,7 +113,7 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ListBox" x:Key="TabGroupListBoxStyle">
|
||||
<Style x:Key="TabGroupListBoxStyle" TargetType="ListBox">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="assists:ControlAssist.Orientation" Value="Horizontal" />
|
||||
@@ -130,15 +130,15 @@
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<Grid>
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{Binding Path=(assists:ControlAssist.CornerRadius), RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
|
||||
Cursor="Hand"
|
||||
x:Name="Border">
|
||||
Cursor="Hand">
|
||||
<ContentPresenter
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Margin="10"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -173,7 +173,7 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="ListBox" x:Key="SlotTabGroupListBoxStyle">
|
||||
<Style x:Key="SlotTabGroupListBoxStyle" TargetType="ListBox">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="assists:ControlAssist.Orientation" Value="Horizontal" />
|
||||
@@ -190,31 +190,31 @@
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<Grid>
|
||||
<decorations:EmbossBorder
|
||||
x:Name="emboss"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{Binding Path=(assists:ControlAssist.CornerRadius), RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
|
||||
Cursor="Hand"
|
||||
ShaderEnabled="False"
|
||||
x:Name="emboss">
|
||||
ShaderEnabled="False">
|
||||
<ContentPresenter
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
Margin="10"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||||
</decorations:EmbossBorder>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="ShaderEnabled" TargetName="emboss" Value="True" />
|
||||
<Setter Property="Background" TargetName="emboss" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter TargetName="emboss" Property="ShaderEnabled" Value="True" />
|
||||
<Setter TargetName="emboss" Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Trigger.EnterActions>
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Duration="0:0:0.3"
|
||||
Storyboard.TargetName="emboss"
|
||||
Storyboard.TargetProperty="Intensity"
|
||||
To="1" />
|
||||
To="1"
|
||||
Duration="0:0:0.3" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.EnterActions>
|
||||
@@ -222,10 +222,10 @@
|
||||
<BeginStoryboard>
|
||||
<Storyboard>
|
||||
<DoubleAnimation
|
||||
Duration="0:0:0.3"
|
||||
Storyboard.TargetName="emboss"
|
||||
Storyboard.TargetProperty="Intensity"
|
||||
To="0" />
|
||||
To="0"
|
||||
Duration="0:0:0.3" />
|
||||
</Storyboard>
|
||||
</BeginStoryboard>
|
||||
</Trigger.ExitActions>
|
||||
@@ -252,16 +252,16 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBox">
|
||||
<decorations:SlotBorder
|
||||
Padding="-4"
|
||||
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
||||
Intensity="0.8"
|
||||
Padding="-4">
|
||||
Intensity="0.8">
|
||||
<ItemsPresenter />
|
||||
</decorations:SlotBorder>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="{x:Type ListBoxItem}" x:Key="DefaultListBoxItemStyle">
|
||||
<Style x:Key="DefaultListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="Padding" Value="10,4" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
@@ -282,17 +282,17 @@
|
||||
IsHitTestVisible="False"
|
||||
Visibility="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(ItemsControl.AlternationIndex), Converter={x:Static internal:InterlacedBackgroundConverter.Instance}}" />
|
||||
<Border
|
||||
x:Name="Bd"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
SnapsToDevicePixels="true"
|
||||
x:Name="Bd">
|
||||
SnapsToDevicePixels="true">
|
||||
<ContentPresenter
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
@@ -300,7 +300,7 @@
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsMouseOver" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
||||
</MultiTrigger>
|
||||
<!-- 选中对象无焦点 -->
|
||||
<MultiTrigger>
|
||||
@@ -308,8 +308,8 @@
|
||||
<Condition Property="Selector.IsSelectionActive" Value="False" />
|
||||
<Condition Property="IsSelected" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource TextAccentBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource TextAccentBrush}" />
|
||||
</MultiTrigger>
|
||||
<!-- 选中对象有焦点 -->
|
||||
<MultiTrigger>
|
||||
@@ -317,11 +317,11 @@
|
||||
<Condition Property="Selector.IsSelectionActive" Value="True" />
|
||||
<Condition Property="IsSelected" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource TextAccentBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource TextAccentBrush}" />
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource TextDisabledBrush}" />
|
||||
<Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
@@ -333,7 +333,7 @@
|
||||
|
||||
<Style BasedOn="{StaticResource DefaultListBoxItemStyle}" TargetType="{x:Type ListBoxItem}" />
|
||||
|
||||
<Style TargetType="{x:Type ListBox}" x:Key="DefaultListBoxStyle">
|
||||
<Style x:Key="DefaultListBoxStyle" TargetType="{x:Type ListBox}">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
@@ -358,20 +358,20 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBox}">
|
||||
<Border
|
||||
x:Name="Bd"
|
||||
Padding="2"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
Padding="2"
|
||||
SnapsToDevicePixels="true"
|
||||
x:Name="Bd">
|
||||
<ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
|
||||
SnapsToDevicePixels="true">
|
||||
<ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false">
|
||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
@@ -403,7 +403,7 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type ListBoxItem}" x:Key="EmbossChipListBoxItemStyle">
|
||||
<Style x:Key="EmbossChipListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
||||
@@ -418,44 +418,44 @@
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<Grid>
|
||||
<decorations:EmbossBorder
|
||||
x:Name="emboss"
|
||||
Margin="0"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Intensity="0.6"
|
||||
Margin="0"
|
||||
ShaderEnabled="True"
|
||||
x:Name="emboss" />
|
||||
ShaderEnabled="True" />
|
||||
<decorations:SlotBorder
|
||||
x:Name="slot"
|
||||
Margin="0"
|
||||
Background="{TemplateBinding Background}"
|
||||
Intensity="0.4"
|
||||
Margin="0"
|
||||
ShaderEnabled="False"
|
||||
x:Name="slot">
|
||||
ShaderEnabled="False">
|
||||
<ContentPresenter
|
||||
Focusable="False"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
x:Name="contentPresenter"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="contentPresenter" />
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</decorations:SlotBorder>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource PrimaryGradientBrush}" />
|
||||
<Setter Property="Visibility" TargetName="emboss" Value="Collapsed" />
|
||||
<Setter Property="ShaderEnabled" TargetName="slot" Value="True" />
|
||||
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource PrimaryGradientBrush}" />
|
||||
<Setter TargetName="emboss" Property="Visibility" Value="Collapsed" />
|
||||
<Setter TargetName="slot" Property="ShaderEnabled" Value="True" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Background" TargetName="emboss" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter Property="Background" TargetName="slot" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
|
||||
<Setter TargetName="emboss" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter TargetName="slot" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="{x:Type ListBox}" x:Key="EmbossChipListBoxStyle">
|
||||
<Style x:Key="EmbossChipListBoxStyle" TargetType="{x:Type ListBox}">
|
||||
<Setter Property="Background" Value="{DynamicResource BackgroundContainerBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
@@ -479,23 +479,23 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBox}">
|
||||
<decorations:EmbossBorder
|
||||
x:Name="Bd"
|
||||
Padding="2"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
Padding="2"
|
||||
SnapsToDevicePixels="true"
|
||||
x:Name="Bd">
|
||||
SnapsToDevicePixels="true">
|
||||
<ScrollViewer
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Focusable="false"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
</decorations:EmbossBorder>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
@@ -509,7 +509,7 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="{x:Type ListBoxItem}" x:Key="ChipListBoxItemStyle">
|
||||
<Style x:Key="ChipListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
||||
@@ -523,36 +523,36 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}"
|
||||
x:Name="ContentBorder"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
x:Name="ContentBorder">
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="{TemplateBinding assists:ControlAssist.CornerRadius}">
|
||||
<ContentPresenter
|
||||
Focusable="False"
|
||||
x:Name="contentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="contentPresenter" />
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="true">
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
||||
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ControlBackgroundHoverBrush}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter Property="Background" TargetName="ContentBorder" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
|
||||
<Setter TargetName="ContentBorder" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style TargetType="{x:Type ListBox}" x:Key="ChipListBoxStyle">
|
||||
<Style x:Key="ChipListBoxStyle" TargetType="{x:Type ListBox}">
|
||||
<Setter Property="Background" Value="{DynamicResource BackgroundContainerBrush}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
@@ -576,23 +576,23 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBox}">
|
||||
<Border
|
||||
x:Name="Bd"
|
||||
Padding="2"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
Padding="2"
|
||||
SnapsToDevicePixels="true"
|
||||
x:Name="Bd">
|
||||
SnapsToDevicePixels="true">
|
||||
<ScrollViewer
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Focusable="false"
|
||||
HorizontalScrollBarVisibility="Disabled"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
HorizontalScrollBarVisibility="Disabled">
|
||||
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Background" TargetName="Bd" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource ControlBackgroundDisabledBrush}" />
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
|
||||
Reference in New Issue
Block a user