|
|
|
@ -1,20 +1,14 @@
|
|
|
|
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
|
|
|
|
|
|
<!--引入字体文件-->
|
|
|
|
|
<Style x:Key="IconStyle" TargetType="TextBlock">
|
|
|
|
|
<Setter Property="FontFamily" Value="/STranslate;component/Images/#iconfont"/>
|
|
|
|
|
</Style>
|
|
|
|
|
|
|
|
|
|
<!--Combox-->
|
|
|
|
|
<Style TargetType="{x:Type ComboBox}" x:Key="cmbstyle">
|
|
|
|
|
<Setter Property="Background" Value="White"/>
|
|
|
|
|
<Setter Property="Background" Value="#f6f6f6"/>
|
|
|
|
|
<Setter Property="ItemContainerStyle">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<!--ComBoxItem-->
|
|
|
|
|
<Style TargetType="ComboBoxItem">
|
|
|
|
|
<Setter Property="MinHeight" Value="22"></Setter>
|
|
|
|
|
<Setter Property="MinWidth" Value="40"></Setter>
|
|
|
|
|
<Setter Property="MinHeight" Value="22"/>
|
|
|
|
|
<Setter Property="MinWidth" Value="40"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="ComboBoxItem">
|
|
|
|
@ -22,14 +16,16 @@
|
|
|
|
|
CornerRadius="2"
|
|
|
|
|
Background="Transparent"
|
|
|
|
|
BorderThickness="0">
|
|
|
|
|
<ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"></ContentPresenter>
|
|
|
|
|
<ContentPresenter VerticalAlignment="Center"
|
|
|
|
|
HorizontalAlignment="Left"
|
|
|
|
|
Margin="5,0,0,0"/>
|
|
|
|
|
</Border>
|
|
|
|
|
<ControlTemplate.Triggers>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
<Setter TargetName="Back" Property="Background" Value="#eaeaea"></Setter>
|
|
|
|
|
<Setter TargetName="Back" Property="Background" Value="#eaeaea"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsHighlighted" Value="True">
|
|
|
|
|
<Setter TargetName="Back" Property="Background" Value="#eaeaea"></Setter>
|
|
|
|
|
<Setter TargetName="Back" Property="Background" Value="#eaeaea"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</ControlTemplate.Triggers>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
@ -41,7 +37,8 @@
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="{x:Type ComboBox}">
|
|
|
|
|
<Border BorderThickness="0" CornerRadius="5" Width="80" Height="30" Background="{TemplateBinding Background}" >
|
|
|
|
|
<Border BorderThickness="0" CornerRadius="5" Width="80" Height="30"
|
|
|
|
|
Background="#f6f6f6" >
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="3*"/>
|
|
|
|
@ -59,7 +56,7 @@
|
|
|
|
|
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press">
|
|
|
|
|
<ToggleButton.Style >
|
|
|
|
|
<Style TargetType="ToggleButton">
|
|
|
|
|
<Setter Property="Background" Value="White"/>
|
|
|
|
|
<Setter Property="Background" Value="#f6f6f6"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
|
|
@ -71,10 +68,10 @@
|
|
|
|
|
</Setter>
|
|
|
|
|
<Style.Triggers>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
|
|
|
<Setter Property="Background" Value="White"/>
|
|
|
|
|
<Setter Property="Background" Value="#f6f6f6"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
<Trigger Property="IsMouseOver" Value="False">
|
|
|
|
|
<Setter Property="Background" Value="White"/>
|
|
|
|
|
<Setter Property="Background" Value="#f6f6f6"/>
|
|
|
|
|
</Trigger>
|
|
|
|
|
</Style.Triggers>
|
|
|
|
|
</Style>
|
|
|
|
@ -88,13 +85,13 @@
|
|
|
|
|
ClickMode="Press">
|
|
|
|
|
<ToggleButton.Style>
|
|
|
|
|
<Style TargetType="ToggleButton">
|
|
|
|
|
<Setter Property="Background" Value="White"/>
|
|
|
|
|
<Setter Property="Background" Value="#f6f6f6"/>
|
|
|
|
|
<Setter Property="Template">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<ControlTemplate TargetType="ToggleButton">
|
|
|
|
|
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
|
|
|
|
|
<Grid>
|
|
|
|
|
<TextBlock Foreground="{TemplateBinding Foreground}" x:Name="arrow_tb" Text="" Style="{StaticResource IconStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
|
|
|
|
<TextBlock Foreground="{TemplateBinding Foreground}" x:Name="arrow_tb" Text="" Style="{DynamicResource IconStyle}" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
|
|
|
|
|
<TextBlock.RenderTransform>
|
|
|
|
|
<TransformGroup>
|
|
|
|
|
<ScaleTransform/>
|
|
|
|
@ -149,21 +146,13 @@
|
|
|
|
|
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
|
|
|
|
MinWidth="{TemplateBinding ActualWidth}"
|
|
|
|
|
SnapsToDevicePixels="True">
|
|
|
|
|
<Border.Effect>
|
|
|
|
|
<DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
|
|
|
|
|
</Border.Effect>
|
|
|
|
|
<ScrollViewer Margin="4,6,4,6" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" CanContentScroll="True">
|
|
|
|
|
<!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
|
|
|
|
|
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
|
|
|
|
|
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="#f6f6f6"/>
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
</Border>
|
|
|
|
|
</Popup>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Border.Effect>
|
|
|
|
|
<DropShadowEffect ShadowDepth="-1" Opacity="0.3" Color="#FF969696" BlurRadius="2"/>
|
|
|
|
|
</Border.Effect>
|
|
|
|
|
</Border>
|
|
|
|
|
</ControlTemplate>
|
|
|
|
|
</Setter.Value>
|
|
|
|
|