|
80 | 80 | <converters:EnumNameConverter x:Key="EnumNameConverter" />
|
81 | 81 |
|
82 | 82 | <Style x:Key="CustomExpanderStyle" TargetType="Expander">
|
83 |
| - <Setter Property="Margin" Value="0 0 0 5" /> |
84 |
| - <Setter Property="HeaderTemplate"> |
| 83 | + <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" /> |
| 84 | + <Setter Property="Background" Value="Transparent" /> |
| 85 | + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
| 86 | + <Setter Property="VerticalContentAlignment" Value="Stretch" /> |
| 87 | + <Setter Property="BorderBrush" Value="{DynamicResource Color03B}" /> |
| 88 | + <Setter Property="Foreground" Value="{DynamicResource Color05B}" /> |
| 89 | + <Setter Property="BorderThickness" Value="1" /> |
| 90 | + <Setter Property="Padding" Value="-8 18 24 14" /> |
| 91 | + <Setter Property="Template"> |
85 | 92 | <Setter.Value>
|
86 |
| - <DataTemplate> |
87 |
| - <TextBlock |
88 |
| - Margin="8 5 0 5" |
89 |
| - FontSize="14" |
90 |
| - Foreground="{DynamicResource Color05B}" |
91 |
| - Text="{Binding}" /> |
92 |
| - </DataTemplate> |
| 93 | + <ControlTemplate TargetType="Expander"> |
| 94 | + <Border |
| 95 | + Background="{TemplateBinding Background}" |
| 96 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 97 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 98 | + SnapsToDevicePixels="true"> |
| 99 | + <DockPanel> |
| 100 | + <ToggleButton |
| 101 | + x:Name="HeaderSite" |
| 102 | + MinWidth="0" |
| 103 | + MinHeight="0" |
| 104 | + Margin="0" |
| 105 | + Padding="{TemplateBinding Padding}" |
| 106 | + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 107 | + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
| 108 | + Content="{TemplateBinding Header}" |
| 109 | + ContentTemplate="{TemplateBinding HeaderTemplate}" |
| 110 | + ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" |
| 111 | + DockPanel.Dock="Top" |
| 112 | + FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" |
| 113 | + FontFamily="{TemplateBinding FontFamily}" |
| 114 | + FontSize="{TemplateBinding FontSize}" |
| 115 | + FontStretch="{TemplateBinding FontStretch}" |
| 116 | + FontStyle="{TemplateBinding FontStyle}" |
| 117 | + FontWeight="{TemplateBinding FontWeight}" |
| 118 | + Foreground="{TemplateBinding Foreground}" |
| 119 | + IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" |
| 120 | + Style="{StaticResource ExpanderHeaderRightArrowStyle}" /> |
| 121 | + <Border x:Name="ContentPresenterBorder" BorderThickness="0,1,0,0" |
| 122 | + BorderBrush="{DynamicResource Color03B}"> |
| 123 | + <ContentPresenter |
| 124 | + x:Name="ExpandSite" |
| 125 | + Margin="{TemplateBinding Padding}" |
| 126 | + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 127 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| 128 | + DockPanel.Dock="Bottom" |
| 129 | + Focusable="false" /> |
| 130 | + <Border.LayoutTransform> |
| 131 | + <ScaleTransform ScaleY="0" /> |
| 132 | + </Border.LayoutTransform> |
| 133 | + </Border> |
| 134 | + </DockPanel> |
| 135 | + </Border> |
| 136 | + <ControlTemplate.Triggers> |
| 137 | + <Trigger Property="IsExpanded" Value="true"> |
| 138 | + <Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" /> |
| 139 | + <Setter TargetName="ContentPresenterBorder" Property="BorderThickness" Value="0 1 0 0" /> |
| 140 | + <Trigger.EnterActions> |
| 141 | + <BeginStoryboard> |
| 142 | + <Storyboard> |
| 143 | + <DoubleAnimation |
| 144 | + Storyboard.TargetName="ContentPresenterBorder" |
| 145 | + Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)" |
| 146 | + From="0.0" To="1.0" Duration="0:0:0" /> |
| 147 | + <DoubleAnimation |
| 148 | + Storyboard.TargetName="ContentPresenterBorder" |
| 149 | + Storyboard.TargetProperty="(Border.Opacity)" |
| 150 | + From="0.0" To="1.0" Duration="0:0:0" /> |
| 151 | + </Storyboard> |
| 152 | + </BeginStoryboard> |
| 153 | + </Trigger.EnterActions> |
| 154 | + <Trigger.ExitActions> |
| 155 | + <BeginStoryboard> |
| 156 | + <Storyboard> |
| 157 | + <DoubleAnimation |
| 158 | + Storyboard.TargetName="ContentPresenterBorder" |
| 159 | + Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)" |
| 160 | + From="1.0" To="0.0" Duration="0:0:0" /> |
| 161 | + <DoubleAnimation |
| 162 | + Storyboard.TargetName="ContentPresenterBorder" |
| 163 | + Storyboard.TargetProperty="(Border.Opacity)" |
| 164 | + From="1.0" To="0.0" Duration="0:0:0" /> |
| 165 | + </Storyboard> |
| 166 | + </BeginStoryboard> |
| 167 | + </Trigger.ExitActions> |
| 168 | + </Trigger> |
| 169 | + </ControlTemplate.Triggers> |
| 170 | + </ControlTemplate> |
93 | 171 | </Setter.Value>
|
94 | 172 | </Setter>
|
95 |
| - <Setter Property="BorderBrush" Value="{DynamicResource Color03B}" /> |
96 |
| - <Setter Property="BorderThickness" Value="0 0 0 1" /> |
97 |
| - <Setter Property="Background" Value="{DynamicResource Color00B}" /> |
98 |
| - <Setter Property="Padding" Value="20 5 20 10" /> |
99 |
| - <!-- Adjusted padding for content --> |
100 | 173 | </Style>
|
101 | 174 | </UserControl.Resources>
|
102 | 175 |
|
|
0 commit comments