| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:UI="clr-namespace:CustomUI">
- <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
- <SolidColorBrush x:Key="Brush.Item.MouseOver.Background" Color="#E2E2E2" />
- <SolidColorBrush x:Key="Brush.Item.Selected.Background" Color="#6452A4" />
- <SolidColorBrush x:Key="Brush.Item.MouseOver.Foreground" Color="#000000" />
- <SolidColorBrush x:Key="Brush.Item.Selected.Foreground" Color="#FFFFFF" />
- <SolidColorBrush x:Key="Light.Border.Normal" Color="#D7DDE4" />
- <SolidColorBrush x:Key="Light.Border.MouseOver" Color="#6452A4" />
- <SolidColorBrush x:Key="ComboBox.Normal.Background" Color="#FFFFFF" />
- <SolidColorBrush x:Key="ComboBox.BorderBrush" Color="#ABADB3" />
- <SolidColorBrush x:Key="ComboBox.Disabled.Foreground" Color="#888" />
- <SolidColorBrush x:Key="ComboBox.Disabled.Background" Color="#eeeeee" />
- <SolidColorBrush x:Key="ComboBox.Disabled.BorderBrush" Color="#888888" />
- <SolidColorBrush x:Key="ComboBox.Popup.BorderBrush" Color="#C8C8C8" />
- <PathGeometry x:Key="Arrow.Down" Figures="M191.814654 383.980301 832.184323 383.980301 512 767.996418Z" />
- <PathGeometry x:Key="Arrow.Up" Figures="M832.185 640.020h-640.37l320.184-384.016z" />
- <ControlTemplate x:Key="ComboBoxToggleButtonTemplate" TargetType="{x:Type UI:ZToggleButton}">
- <Grid Background="Transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <Border
- x:Name="ShadowBorder"
- Grid.ColumnSpan="2"
- Background="#FFFFFF"
- CornerRadius="{TemplateBinding CornerRadius}"
- SnapsToDevicePixels="True"
- UseLayoutRounding="True">
- <Border.Effect>
- <DropShadowEffect
- BlurRadius="5"
- Opacity="0.2"
- ShadowDepth="0"
- Color="Transparent" />
- </Border.Effect>
- </Border>
- <Border
- Name="Border"
- Grid.ColumnSpan="2"
- Background="{StaticResource ComboBox.Normal.Background}"
- BorderBrush="{StaticResource Light.Border.Normal}"
- BorderThickness="1,1,1,1"
- CornerRadius="{TemplateBinding CornerRadius}"
- SnapsToDevicePixels="True"
- UseLayoutRounding="True" />
- <Border
- Name="ButtonBorder"
- Grid.Column="1"
- Margin="1,1,1,1"
- Padding="5,0,8,0"
- Background="{StaticResource ComboBox.Normal.Background}"
- CornerRadius="{Binding CornerRadius, ElementName=Border}">
- <Path
- Name="Arrow"
- Grid.Column="1"
- Width="10"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Data="{StaticResource Arrow.Down}"
- Fill="{StaticResource ComboBox.BorderBrush}"
- RenderTransformOrigin="0.5,0.5"
- SnapsToDevicePixels="True"
- Stretch="Uniform"
- UseLayoutRounding="True">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform />
- <TranslateTransform />
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- </Border>
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="CheckStates">
- <VisualState x:Name="Checked">
- <Storyboard>
- <DoubleAnimation
- Storyboard.TargetName="Arrow"
- Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
- To="180"
- Duration="0:0:0.2" />
- <ColorAnimation
- Storyboard.TargetName="ShadowBorder"
- Storyboard.TargetProperty="(Border.Effect).(DropShadowEffect.Color)"
- To="Brown"
- Duration="0:0:0.2" />
- </Storyboard>
- </VisualState>
- <VisualState x:Name="Unchecked">
- <Storyboard>
- <DoubleAnimation
- Storyboard.TargetName="Arrow"
- Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
- To="0"
- Duration="0:0:0.2" />
- <ColorAnimation
- Storyboard.TargetName="ShadowBorder"
- Storyboard.TargetProperty="(Border.Effect).(DropShadowEffect.Color)"
- To="Transparent"
- Duration="0:0:0.2" />
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource Light.Border.MouseOver}" />
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="ToggleButton.IsChecked" Value="True" />
- <Condition Property="IsMouseOver" Value="False" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource Light.Border.MouseOver}" />
- </MultiTrigger>
- <Trigger Property="UIElement.IsEnabled" Value="False">
- <Setter TargetName="Border" Property="Panel.Background" Value="{StaticResource ComboBox.Disabled.Background}" />
- <Setter TargetName="Border" Property="Border.BorderBrush" Value="{StaticResource ComboBox.Disabled.BorderBrush}" />
- <Setter TargetName="ButtonBorder" Property="Panel.Background" Value="{StaticResource ComboBox.Disabled.Background}" />
- <Setter TargetName="ButtonBorder" Property="Border.BorderBrush" Value="{StaticResource ComboBox.Disabled.BorderBrush}" />
- <Setter Property="TextElement.Foreground" Value="{StaticResource ComboBox.Disabled.Foreground}" />
- <Setter TargetName="Arrow" Property="Stroke" Value="#999" />
- <Setter TargetName="Arrow" Property="StrokeThickness" Value="0" />
- <Setter Property="Cursor" Value="No" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <Style TargetType="UI:CheckComboBoxItem">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="UI:CheckComboBoxItem">
- <Border
- Padding="5"
- Background="{TemplateBinding Background}"
- BorderBrush="{StaticResource ComboBox.Popup.BorderBrush}"
- BorderThickness="0">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <UI:FlatCheckBox IsChecked="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=UI:CheckComboBoxItem}}" />
- <ContentPresenter
- Grid.Column="1"
- Margin="5,0,0,0"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentTemplate="{TemplateBinding ContentTemplate}" />
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Background" Value="{StaticResource Brush.Item.MouseOver.Background}" />
- <Setter Property="Foreground" Value="{StaticResource Brush.Item.MouseOver.Foreground}" />
- </Trigger>
- <!--<Trigger Property="IsSelected" Value="True">
- <Setter Property="Background" Value="{StaticResource Brush.Item.Selected.Background}" />
- <Setter Property="Foreground" Value="{StaticResource Brush.Item.Selected.Foreground}" />
- </Trigger>-->
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="{x:Type UI:CheckComboBox}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="Foreground" Value="#3F3F3F" />
- <Setter Property="Padding" Value="5,0,25,0" />
- <Setter Property="HorizontalContentAlignment" Value="Left" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="UseLayoutRounding" Value="True" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type UI:CheckComboBox}">
- <Grid>
- <UI:ZToggleButton
- x:Name="toggleButton"
- ClickMode="Press"
- Focusable="False"
- IsChecked="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
- Template="{StaticResource ComboBoxToggleButtonTemplate}" />
- <ContentPresenter
- x:Name="PART_ContentSite"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- IsHitTestVisible="False" />
- <Popup
- Name="PART_Popup"
- MinWidth="{TemplateBinding FrameworkElement.ActualWidth}"
- MaxHeight="{TemplateBinding MaxDropDownHeight}"
- AllowsTransparency="True"
- IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
- Placement="Bottom"
- StaysOpen="False"
- VerticalOffset="1">
- <Grid
- Name="DropDown"
- Width="{TemplateBinding FrameworkElement.ActualWidth}"
- MaxHeight="{TemplateBinding ComboBox.MaxDropDownHeight}"
- Margin="10,0,10,10"
- SnapsToDevicePixels="True">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Border
- Grid.RowSpan="2"
- Background="#FFFFFF"
- CornerRadius="3"
- SnapsToDevicePixels="True"
- UseLayoutRounding="True">
- <Border.Effect>
- <DropShadowEffect
- BlurRadius="7"
- Opacity="0.2"
- ShadowDepth="0"
- Color="Brown" />
- </Border.Effect>
- </Border>
- <Border
- Name="DropDownBorder"
- Grid.RowSpan="2"
- Background="#FFFFFF"
- BorderBrush="{StaticResource ComboBox.Popup.BorderBrush}"
- BorderThickness="1"
- CornerRadius="3"
- SnapsToDevicePixels="True"
- UseLayoutRounding="True" />
- <UI:ZTextBox
- x:Name="PART_FilterTextBox"
- Height="26"
- Margin="5,5,5,3"
- UI:WatermarkAdorner.Watermark="{TemplateBinding FilterBoxWatermark}"
- Visibility="{Binding IsShowFilterBox, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}" />
- <UI:ZScrollViewer
- Grid.Row="1"
- Margin="0,3,0,3"
- SnapsToDevicePixels="True">
- <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained" />
- </UI:ZScrollViewer>
- </Grid>
- </Popup>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Cursor" Value="No" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|