This commit is contained in:
NaBian committed 2021-01-16 17:21:15 +08:00
1 parent 371840d248
commit 98586f6404
4 files changed
+430 -46

No files matched your search

+127 -15
View File
@@ -8216,18 +8216,110 @@
<Setter Property="Dock" Value="Right" /> <Setter Property="Dock" Value="Right" />
<Setter Property="MaskBrush" Value="{DynamicResource DarkOpacityBrush}" /> <Setter Property="MaskBrush" Value="{DynamicResource DarkOpacityBrush}" />
</Style> </Style>
<Style x:Key="ExpanderBaseStyle" TargetType="Expander"> <ControlTemplate x:Key="ExpanderLeftTemplate" TargetType="Expander">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" /> <Grid>
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" /> <Grid.ColumnDefinitions>
<Setter Property="HorizontalContentAlignment" Value="Left" /> <ColumnDefinition Width="Auto" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <ColumnDefinition Width="Auto" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" /> </Grid.ColumnDefinitions>
<Setter Property="BorderThickness" Value="1" /> <Border x:Name="BorderHeader" Grid.Column="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" /> <ToggleButton VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Focusable="False" Padding="0,0,0,10" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="{TemplateBinding MinWidth}" Style="{StaticResource ToggleButtonCustom}">
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Grid>
<Setter Property="Template"> <Grid.ColumnDefinitions>
<Setter.Value> <ColumnDefinition />
<ControlTemplate TargetType="Expander"> <ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<Grid.LayoutTransform>
<TransformGroup>
<RotateTransform Angle="-90" />
</TransformGroup>
</Grid.LayoutTransform>
<ContentPresenter ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Path Name="PathArrow" IsHitTestVisible="False" Grid.Column="1" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Data="{StaticResource UpGeometry}" Margin="0,0,10,0" Width="12" Height="12" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="Right" />
</Grid>
</ToggleButton>
</Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Column="0" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="CornerRadius" TargetName="BorderHeader" Value="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='0,1,1,0'}" />
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
<Setter Property="Data" TargetName="PathArrow" Value="{StaticResource DownGeometry}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ExpanderUpTemplate" TargetType="Expander">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border x:Name="BorderHeader" Grid.Row="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<ToggleButton HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Focusable="False" Padding="10,0,0,0" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinHeight="{TemplateBinding MinHeight}" Style="{StaticResource ToggleButtonCustom}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<ContentPresenter ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Path Name="PathArrow" IsHitTestVisible="False" Grid.Column="1" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Data="{StaticResource UpGeometry}" Margin="0,0,10,0" Width="12" Height="12" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="Right" />
</Grid>
</ToggleButton>
</Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Row="0" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="CornerRadius" TargetName="BorderHeader" Value="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='0,0,1,1'}" />
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
<Setter Property="Data" TargetName="PathArrow" Value="{StaticResource DownGeometry}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ExpanderRightTemplate" TargetType="Expander">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border x:Name="BorderHeader" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<ToggleButton VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Focusable="False" Padding="0,0,0,10" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="{TemplateBinding MinWidth}" Style="{StaticResource ToggleButtonCustom}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<Grid.LayoutTransform>
<TransformGroup>
<RotateTransform Angle="-90" />
</TransformGroup>
</Grid.LayoutTransform>
<ContentPresenter ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Path Name="PathArrow" IsHitTestVisible="False" Grid.Column="1" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Data="{StaticResource DownGeometry}" Margin="0,0,10,0" Width="12" Height="12" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="Right" />
</Grid>
</ToggleButton>
</Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Column="1" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="CornerRadius" TargetName="BorderHeader" Value="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='1,0,0,1'}" />
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
<Setter Property="Data" TargetName="PathArrow" Value="{StaticResource UpGeometry}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ExpanderDownTemplate" TargetType="Expander">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@@ -8245,7 +8337,7 @@
</Grid> </Grid>
</ToggleButton> </ToggleButton>
</Border> </Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Row="1" Grid.Column="0" /> <ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Row="1" />
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true"> <Trigger Property="IsExpanded" Value="true">
@@ -8258,8 +8350,28 @@
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
</Setter.Value> <Style x:Key="ExpanderBaseStyle" TargetType="Expander">
</Setter> <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="MinWidth" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="Template" Value="{StaticResource ExpanderDownTemplate}" />
<Style.Triggers>
<Trigger Property="ExpandDirection" Value="Left">
<Setter Property="Template" Value="{StaticResource ExpanderLeftTemplate}" />
</Trigger>
<Trigger Property="ExpandDirection" Value="Up">
<Setter Property="Template" Value="{StaticResource ExpanderUpTemplate}" />
</Trigger>
<Trigger Property="ExpandDirection" Value="Right">
<Setter Property="Template" Value="{StaticResource ExpanderRightTemplate}" />
</Trigger>
</Style.Triggers>
</Style> </Style>
<Style x:Key="FlowDocumentScrollViewerBaseStyle" TargetType="FlowDocumentScrollViewer"> <Style x:Key="FlowDocumentScrollViewerBaseStyle" TargetType="FlowDocumentScrollViewer">
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
@@ -6,7 +6,8 @@
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension" xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
xmlns:hc="https://handyorg.github.io/handycontrol"> xmlns:hc="https://handyorg.github.io/handycontrol">
<hc:TransitioningContentControl> <hc:TransitioningContentControl>
<StackPanel Margin="32" VerticalAlignment="Center" Width="240"> <WrapPanel Margin="16" HorizontalAlignment="Center" VerticalAlignment="Center">
<StackPanel Width="240" Margin="16">
<Expander Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}"> <Expander Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}">
<Border Height="100" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="0,0,4,4"/> <Border Height="100" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="0,0,4,4"/>
</Expander> </Expander>
@@ -20,5 +21,48 @@
<Border Height="100" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="0,0,4,4"/> <Border Height="100" BorderThickness="1,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="0,0,4,4"/>
</Expander> </Expander>
</StackPanel> </StackPanel>
<StackPanel Width="240" Margin="16">
<Expander Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Up">
<Border Height="100" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="4,4,0,0"/>
</Expander>
<Expander Margin="0,4,0,0" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Up">
<Border Height="100" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="4,4,0,0"/>
</Expander>
<Expander Margin="0,4,0,0" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Up">
<Border Height="100" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="4,4,0,0"/>
</Expander>
<Expander Margin="0,4,0,0" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Up">
<Border Height="100" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="4,4,0,0"/>
</Expander>
</StackPanel>
<StackPanel Height="240" Margin="16" Orientation="Horizontal">
<Expander Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Left">
<Border Width="100" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="4,0,0,4"/>
</Expander>
<Expander Margin="4,0,0,0" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Left">
<Border Width="100" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="4,0,0,4"/>
</Expander>
<Expander Margin="4,0,0,0" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Left">
<Border Width="100" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="4,0,0,4"/>
</Expander>
<Expander Margin="4,0,0,0" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Left">
<Border Width="100" BorderThickness="1,1,0,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="4,0,0,4"/>
</Expander>
</StackPanel>
<StackPanel Height="240" Margin="16" Orientation="Horizontal">
<Expander Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Right">
<Border Width="100" BorderThickness="0,1,1,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="0,4,4,0"/>
</Expander>
<Expander Margin="4,0,0,0" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Right">
<Border Width="100" BorderThickness="0,1,1,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="0,4,4,0"/>
</Expander>
<Expander Margin="4,0,0,0" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Right">
<Border Width="100" BorderThickness="0,1,1,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="0,4,4,0"/>
</Expander>
<Expander Margin="4,0,0,0" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" ExpandDirection="Right">
<Border Width="100" BorderThickness="0,1,1,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" CornerRadius="0,4,4,0"/>
</Expander>
</StackPanel>
</WrapPanel>
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</UserControl> </UserControl>
@@ -9,18 +9,113 @@
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/ToggleBlock.xaml"/> <themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/ToggleBlock.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style x:Key="ExpanderBaseStyle" TargetType="Expander"> <ControlTemplate x:Key="ExpanderLeftTemplate" TargetType="Expander">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/> <Grid>
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/> <Grid.ColumnDefinitions>
<Setter Property="HorizontalContentAlignment" Value="Left"/> <ColumnDefinition Width="Auto"/>
<Setter Property="VerticalContentAlignment" Value="Center"/> <ColumnDefinition Width="Auto"/>
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/> </Grid.ColumnDefinitions>
<Setter Property="BorderThickness" Value="1"/> <Border x:Name="BorderHeader" Grid.Column="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}"/> <ToggleButton VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Focusable="False" Padding="0,0,0,10" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="{TemplateBinding MinWidth}" Style="{StaticResource ToggleButtonCustom}">
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/> <Grid>
<Setter Property="Template"> <Grid.ColumnDefinitions>
<Setter.Value> <ColumnDefinition />
<ControlTemplate TargetType="Expander"> <ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<Grid.LayoutTransform>
<TransformGroup>
<RotateTransform Angle="-90"/>
</TransformGroup>
</Grid.LayoutTransform>
<ContentPresenter ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Path Name="PathArrow" IsHitTestVisible="False" Grid.Column="1" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Data="{StaticResource UpGeometry}" Margin="0,0,10,0" Width="12" Height="12" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="Right" />
</Grid>
</ToggleButton>
</Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Column="0" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="CornerRadius" TargetName="BorderHeader" Value="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='0,1,1,0'}" />
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
<Setter Property="Data" TargetName="PathArrow" Value="{StaticResource DownGeometry}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ExpanderUpTemplate" TargetType="Expander">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border x:Name="BorderHeader" Grid.Row="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<ToggleButton HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Focusable="False" Padding="10,0,0,0" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinHeight="{TemplateBinding MinHeight}" Style="{StaticResource ToggleButtonCustom}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<ContentPresenter ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Path Name="PathArrow" IsHitTestVisible="False" Grid.Column="1" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Data="{StaticResource UpGeometry}" Margin="0,0,10,0" Width="12" Height="12" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="Right" />
</Grid>
</ToggleButton>
</Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Row="0" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="CornerRadius" TargetName="BorderHeader" Value="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='0,0,1,1'}" />
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
<Setter Property="Data" TargetName="PathArrow" Value="{StaticResource DownGeometry}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ExpanderRightTemplate" TargetType="Expander">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Border x:Name="BorderHeader" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<ToggleButton VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Focusable="False" Padding="0,0,0,10" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="{TemplateBinding MinWidth}" Style="{StaticResource ToggleButtonCustom}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<Grid.LayoutTransform>
<TransformGroup>
<RotateTransform Angle="-90"/>
</TransformGroup>
</Grid.LayoutTransform>
<ContentPresenter ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Path Name="PathArrow" IsHitTestVisible="False" Grid.Column="1" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Data="{StaticResource DownGeometry}" Margin="0,0,10,0" Width="12" Height="12" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="Right" />
</Grid>
</ToggleButton>
</Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Column="1" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="CornerRadius" TargetName="BorderHeader" Value="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='1,0,0,1'}" />
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
<Setter Property="Data" TargetName="PathArrow" Value="{StaticResource UpGeometry}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ExpanderDownTemplate" TargetType="Expander">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@@ -38,7 +133,7 @@
</Grid> </Grid>
</ToggleButton> </ToggleButton>
</Border> </Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Row="1" Grid.Column="0"/> <ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Row="1" />
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true"> <Trigger Property="IsExpanded" Value="true">
@@ -51,8 +146,29 @@
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
</Setter.Value>
</Setter> <Style x:Key="ExpanderBaseStyle" TargetType="Expander">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="MinWidth" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="Template" Value="{StaticResource ExpanderDownTemplate}"/>
<Style.Triggers>
<Trigger Property="ExpandDirection" Value="Left">
<Setter Property="Template" Value="{StaticResource ExpanderLeftTemplate}"/>
</Trigger>
<Trigger Property="ExpandDirection" Value="Up">
<Setter Property="Template" Value="{StaticResource ExpanderUpTemplate}"/>
</Trigger>
<Trigger Property="ExpandDirection" Value="Right">
<Setter Property="Template" Value="{StaticResource ExpanderRightTemplate}"/>
</Trigger>
</Style.Triggers>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>
+127 -15
View File
@@ -8334,18 +8334,110 @@
<Setter Property="Dock" Value="Right" /> <Setter Property="Dock" Value="Right" />
<Setter Property="MaskBrush" Value="{DynamicResource DarkOpacityBrush}" /> <Setter Property="MaskBrush" Value="{DynamicResource DarkOpacityBrush}" />
</Style> </Style>
<Style x:Key="ExpanderBaseStyle" TargetType="Expander"> <ControlTemplate x:Key="ExpanderLeftTemplate" TargetType="Expander">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" /> <Grid>
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" /> <Grid.ColumnDefinitions>
<Setter Property="HorizontalContentAlignment" Value="Left" /> <ColumnDefinition Width="Auto" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <ColumnDefinition Width="Auto" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" /> </Grid.ColumnDefinitions>
<Setter Property="BorderThickness" Value="1" /> <Border x:Name="BorderHeader" Grid.Column="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" /> <ToggleButton VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Focusable="False" Padding="0,0,0,10" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="{TemplateBinding MinWidth}" Style="{StaticResource ToggleButtonCustom}">
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Grid>
<Setter Property="Template"> <Grid.ColumnDefinitions>
<Setter.Value> <ColumnDefinition />
<ControlTemplate TargetType="Expander"> <ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<Grid.LayoutTransform>
<TransformGroup>
<RotateTransform Angle="-90" />
</TransformGroup>
</Grid.LayoutTransform>
<ContentPresenter ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Path Name="PathArrow" IsHitTestVisible="False" Grid.Column="1" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Data="{StaticResource UpGeometry}" Margin="0,0,10,0" Width="12" Height="12" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="Right" />
</Grid>
</ToggleButton>
</Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Column="0" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="CornerRadius" TargetName="BorderHeader" Value="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='0,1,1,0'}" />
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
<Setter Property="Data" TargetName="PathArrow" Value="{StaticResource DownGeometry}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ExpanderUpTemplate" TargetType="Expander">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Border x:Name="BorderHeader" Grid.Row="1" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<ToggleButton HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch" Focusable="False" Padding="10,0,0,0" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinHeight="{TemplateBinding MinHeight}" Style="{StaticResource ToggleButtonCustom}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<ContentPresenter ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Path Name="PathArrow" IsHitTestVisible="False" Grid.Column="1" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Data="{StaticResource UpGeometry}" Margin="0,0,10,0" Width="12" Height="12" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="Right" />
</Grid>
</ToggleButton>
</Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Row="0" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="CornerRadius" TargetName="BorderHeader" Value="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='0,0,1,1'}" />
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
<Setter Property="Data" TargetName="PathArrow" Value="{StaticResource DownGeometry}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ExpanderRightTemplate" TargetType="Expander">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Border x:Name="BorderHeader" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
<ToggleButton VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" Focusable="False" Padding="0,0,0,10" Foreground="{TemplateBinding Foreground}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" MinWidth="{TemplateBinding MinWidth}" Style="{StaticResource ToggleButtonCustom}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="32" />
</Grid.ColumnDefinitions>
<Grid.LayoutTransform>
<TransformGroup>
<RotateTransform Angle="-90" />
</TransformGroup>
</Grid.LayoutTransform>
<ContentPresenter ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<Path Name="PathArrow" IsHitTestVisible="False" Grid.Column="1" Stretch="Uniform" Fill="{TemplateBinding Foreground}" Data="{StaticResource DownGeometry}" Margin="0,0,10,0" Width="12" Height="12" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="Right" />
</Grid>
</ToggleButton>
</Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Column="1" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter Property="CornerRadius" TargetName="BorderHeader" Value="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter}, ConverterParameter='1,0,0,1'}" />
<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible" />
<Setter Property="Data" TargetName="PathArrow" Value="{StaticResource UpGeometry}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate x:Key="ExpanderDownTemplate" TargetType="Expander">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@@ -8363,7 +8455,7 @@
</Grid> </Grid>
</ToggleButton> </ToggleButton>
</Border> </Border>
<ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Row="1" Grid.Column="0" /> <ContentPresenter Name="ExpandSite" Visibility="Collapsed" Grid.Row="1" />
</Grid> </Grid>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true"> <Trigger Property="IsExpanded" Value="true">
@@ -8376,8 +8468,28 @@
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
</Setter.Value> <Style x:Key="ExpanderBaseStyle" TargetType="Expander">
</Setter> <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="MinWidth" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="Template" Value="{StaticResource ExpanderDownTemplate}" />
<Style.Triggers>
<Trigger Property="ExpandDirection" Value="Left">
<Setter Property="Template" Value="{StaticResource ExpanderLeftTemplate}" />
</Trigger>
<Trigger Property="ExpandDirection" Value="Up">
<Setter Property="Template" Value="{StaticResource ExpanderUpTemplate}" />
</Trigger>
<Trigger Property="ExpandDirection" Value="Right">
<Setter Property="Template" Value="{StaticResource ExpanderRightTemplate}" />
</Trigger>
</Style.Triggers>
</Style> </Style>
<Style x:Key="FlowDocumentScrollViewerBaseStyle" TargetType="FlowDocumentScrollViewer"> <Style x:Key="FlowDocumentScrollViewerBaseStyle" TargetType="FlowDocumentScrollViewer">
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />