123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <Style x:Key="ExpanderHeaderFocusVisual">
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Border>
- <Rectangle Margin="0" SnapsToDevicePixels="true" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <SolidColorBrush x:Key="Expander_Header_BG" Color="#FFd1e3cf"/>
- <SolidColorBrush x:Key="Expander_Header_BD" Color="Black"/>
- <SolidColorBrush x:Key="Expander_Header_BG_HighLight" Color="#FFD6E4FF"/>
- <SolidColorBrush x:Key="Expander_InnerHighlight" Color="#FF9FCDED"/>
- <SolidColorBrush x:Key="Expander_InnerShadow" Color="#FF003A62"/>
- <SolidColorBrush x:Key="Expander_BG_MouseOver" Color="#FF00ae72"/>
- <Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
- <Setter Property="FontSize" Value="14"/>
- <Setter Property="MinWidth" Value="100"/>
- <Setter Property="FontFamily" Value="Arial"/>
- <Setter Property="BorderBrush" Value="{DynamicResource Expander_Header_BD}"/>
- <Setter Property="Background" Value="{DynamicResource Expander_Header_BG}"/>
- <Setter Property="Foreground" Value="{DynamicResource FG_White}"/>
- <Setter Property="Border.CornerRadius" Value="5"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Grid Cursor="Hand" Background="Transparent">
- <Border x:Name="OuterBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" CornerRadius="{TemplateBinding Border.CornerRadius}" Background="{TemplateBinding Background}">
- <Border x:Name="InnerBD_Highlight" BorderThickness="2,2,0,0" BorderBrush="{DynamicResource Expander_InnerHighlight}" CornerRadius="4">
- <Border x:Name="InnerBD_Shadow" BorderThickness="0,0,2,2" BorderBrush="{DynamicResource Expander_InnerShadow}" CornerRadius="4" Padding="3">
- <Grid SnapsToDevicePixels="False">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="17"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <Grid Grid.Column="0">
- <Ellipse Stroke="{DynamicResource Expander_InnerHighlight}" StrokeThickness="1" Width="15" Height="15"/>
- <Rectangle x:Name="Path1" Fill="White" Height="2" Width="9"/>
- <Rectangle x:Name="Path2" Fill="White" Height="9" Width="2"/>
- </Grid>
- <ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="15,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
- </Grid>
- </Border>
- </Border>
- </Border>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="true">
- <Setter Property="Visibility" TargetName="Path2" Value="Collapsed"/>
- <Setter Property="Border.CornerRadius" TargetName="OuterBorder" Value="5,5,0,0"/>
- <Setter Property="Border.CornerRadius" TargetName="InnerBD_Highlight" Value="4,4,0,0"/>
- <Setter Property="Border.CornerRadius" TargetName="InnerBD_Shadow" Value="4,4,0,0"/>
- <Setter Property="BorderThickness" TargetName="InnerBD_Shadow" Value="0,0,2,0"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" TargetName="OuterBorder" Value="{DynamicResource Expander_BG_MouseOver}"/>
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter Property="Background" TargetName="OuterBorder" Value="{DynamicResource Expander_BG_MouseOver}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
- <Setter Property="FontSize" Value="14"/>
- <Setter Property="FontFamily" Value="Arial"/>
- <Setter Property="Foreground" Value="{DynamicResource FG_Black}"/>
- <Setter Property="Background" Value="{DynamicResource Expander_Header_BG}"/>
- <Setter Property="BorderBrush" Value="{DynamicResource Expander_Header_BD}"/>
- <Setter Property="Border.CornerRadius" Value="2"/>
- <Setter Property="Opacity" Value="1"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Grid Cursor="Hand" Background="Transparent">
- <Grid.LayoutTransform>
- <TransformGroup>
- <TransformGroup.Children>
- <TransformCollection>
- <RotateTransform Angle="-90"/>
- </TransformCollection>
- </TransformGroup.Children>
- </TransformGroup>
- </Grid.LayoutTransform>
- <Grid SnapsToDevicePixels="False" Margin="0,5">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="17"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <Border x:Name="OuterBorder" Grid.Column="0" HorizontalAlignment="Right" Height="15" BorderBrush="{DynamicResource Expander_Header_BD}" BorderThickness="1" Background="{DynamicResource Expander_Header_BG}" CornerRadius="2" VerticalAlignment="Center" Width="15">
- <Grid>
- <Rectangle x:Name="Path1" Fill="White" Height="2" Width="9">
- <Rectangle.LayoutTransform>
- <TransformGroup>
- <TransformGroup.Children>
- <TransformCollection>
- <RotateTransform Angle="-90"/>
- </TransformCollection>
- </TransformGroup.Children>
- </TransformGroup>
- </Rectangle.LayoutTransform>
- </Rectangle>
- <Rectangle x:Name="Path2" Fill="White" Height="9" Width="2">
- <Rectangle.LayoutTransform>
- <TransformGroup>
- <TransformGroup.Children>
- <TransformCollection>
- <RotateTransform Angle="-90"/>
- </TransformCollection>
- </TransformGroup.Children>
- </TransformGroup>
- </Rectangle.LayoutTransform>
- </Rectangle>
- </Grid>
- </Border>
- <ContentPresenter Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0" RecognizesAccessKey="True" SnapsToDevicePixels="True"/>
- </Grid>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="true">
- <Setter Property="Visibility" TargetName="Path2" Value="Collapsed"/>
- <Setter Property="Background" TargetName="OuterBorder" Value="{DynamicResource Expander_Header_BG_HighLight}"/>
- <Setter Property="Fill" TargetName="Path1" Value="Black"/>
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true"/>
- <Trigger Property="IsPressed" Value="true">
- <Setter Property="Background" TargetName="OuterBorder" Value="{DynamicResource Expander_Header_BG_HighLight}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style TargetType="{x:Type Expander}">
- <Setter Property="BorderThickness" Value="0"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Expander}">
- <Grid>
- <DockPanel>
- <ToggleButton x:Name="HeaderSite"
- ContentTemplate="{TemplateBinding HeaderTemplate}"
- ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
- Content="{TemplateBinding Header}"
- DockPanel.Dock="Top"
- FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}"
- HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
- IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
- MinWidth="0"
- MinHeight="0"
- Style="{StaticResource ExpanderDownHeaderStyle}"
- VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
- <ContentPresenter x:Name="ExpandSite" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" DockPanel.Dock="Bottom"/>
- </DockPanel>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsExpanded" Value="true">
- <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
- </Trigger>
- <Trigger Property="ExpandDirection" Value="Right">
- <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
- <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
- <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|