|
3 | 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
4 | 4 | xmlns:chelper="clr-namespace:iNKORE.UI.WPF.Modern.Controls.Helpers;assembly=iNKORE.UI.WPF.Modern" |
5 | 5 | xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf" |
| 6 | + xmlns:converters="clr-namespace:iNKORE.UI.WPF.Modern.Common.Converters;assembly=iNKORE.UI.WPF.Modern" |
| 7 | + xmlns:common="clr-namespace:iNKORE.UI.WPF.Modern.Common;assembly=iNKORE.UI.WPF.Modern" |
6 | 8 | xmlns:local="clr-namespace:iNKORE.UI.WPF.Modern.Controls" |
7 | 9 | xmlns:sys="clr-namespace:System;assembly=System.Runtime" |
8 | 10 | xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"> |
|
146 | 148 | <ikw:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="Left" /> |
147 | 149 |
|
148 | 150 | <ikw:SizeToRectConverter x:Key="SizeToRectConverter" /> |
149 | | - |
150 | | - <sys:TimeSpan x:Key="ExpandAnimationDuration">0:0:0.333</sys:TimeSpan> |
151 | | - <sys:TimeSpan x:Key="CollapseAnimationDuration">0:0:0.167</sys:TimeSpan> |
152 | | - |
153 | 151 | <Style x:Key="SettingsExpanderExpanderStyle" TargetType="Expander"> |
154 | 152 | <Setter Property="Background" Value="{DynamicResource ExpanderContentBackground}" /> |
155 | 153 | <Setter Property="MinWidth" Value="{DynamicResource FlyoutThemeMinWidth}" /> |
|
160 | 158 | <Setter Property="HorizontalAlignment" Value="Left" /> |
161 | 159 | <Setter Property="VerticalAlignment" Value="Center" /> |
162 | 160 | <Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
163 | | - <Setter Property="chelper:ExpanderAnimationsHelper.CollapseAnimationDuration" Value="{DynamicResource CollapseAnimationDuration}" /> |
164 | | - <Setter Property="chelper:ExpanderAnimationsHelper.ExpandAnimationDuration" Value="{DynamicResource ExpandAnimationDuration}" /> |
165 | | - <Setter Property="chelper:ExpanderAnimationsHelper.ToAnimateControlName" Value="ExpanderContent" /> |
166 | 161 | <Setter Property="chelper:ExpanderAnimationsHelper.IsEnabled" Value="True" /> |
| 162 | + <Setter Property="chelper:ExpanderAnimationsHelper.ExpandAnimationDuration" Value="{DynamicResource ExpandAnimationDuration}" /> |
| 163 | + <Setter Property="chelper:ExpanderAnimationsHelper.CollapseAnimationDuration" Value="{DynamicResource CollapseAnimationDuration}" /> |
167 | 164 | <Setter Property="Template"> |
168 | 165 | <Setter.Value> |
169 | 166 | <ControlTemplate TargetType="Expander"> |
|
174 | 171 | </Grid.RowDefinitions> |
175 | 172 |
|
176 | 173 | <!-- The clip is a composition clip applied in code --> |
177 | | - <Border x:Name="ExpanderContentClip" Grid.Row="1"> |
178 | | - |
179 | | - <Border.Clip> |
180 | | - <RectangleGeometry> |
181 | | - <RectangleGeometry.Rect> |
182 | | - <MultiBinding Converter="{StaticResource SizeToRectConverter}"> |
183 | | - <Binding Source="0" /> |
184 | | - <Binding Source="0" /> |
185 | | - <Binding |
186 | | - Mode="OneWay" |
187 | | - Path="ActualWidth" |
188 | | - RelativeSource="{RelativeSource Mode=TemplatedParent}" /> |
189 | | - <Binding |
190 | | - ElementName="ContentPresenter" |
191 | | - Mode="OneWay" |
192 | | - Path="ActualHeight" /> |
193 | | - </MultiBinding> |
194 | | - </RectangleGeometry.Rect> |
195 | | - </RectangleGeometry> |
196 | | - </Border.Clip> |
197 | | - |
| 174 | + <ikw:ClippedContent x:Name="ExpanderContentClip" Grid.Row="1" |
| 175 | + ClipToBounds="True"> |
198 | 176 | <ikw:ClippedContent |
199 | 177 | x:Name="ExpanderContent" |
200 | 178 | MinHeight="{DynamicResource SettingsExpanderContentMinHeight}" |
|
204 | 182 | BorderBrush="{TemplateBinding BorderBrush}" |
205 | 183 | BorderThickness="{StaticResource ExpanderContentDownBorderThickness}" |
206 | 184 | CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius, |
207 | | - Converter={StaticResource BottomCornerRadiusFilterConverter}}" |
208 | | - Visibility="Collapsed"> |
| 185 | + Converter={StaticResource BottomCornerRadiusFilterConverter}}"> |
209 | 186 | <FrameworkElement.RenderTransform> |
210 | 187 | <TranslateTransform x:Name="ExpanderContentTranslation" /> |
211 | 188 | </FrameworkElement.RenderTransform> |
| 189 | + |
212 | 190 | <ui:ContentPresenterEx |
213 | 191 | x:Name="ContentPresenter" |
214 | 192 | Margin="0,-2,0,0" |
|
218 | 196 | ContentTemplate="{TemplateBinding ContentTemplate}" |
219 | 197 | ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" /> |
220 | 198 | </ikw:ClippedContent> |
221 | | - </Border> |
| 199 | + </ikw:ClippedContent> |
222 | 200 |
|
223 | 201 | <ToggleButton x:Name="ExpanderHeader" |
224 | 202 | MinHeight="{TemplateBinding MinHeight}" |
|
238 | 216 | IsEnabled="{TemplateBinding IsEnabled}" |
239 | 217 | IsTabStop="True" |
240 | 218 | Style="{StaticResource SettingsExpanderHeaderDownStyle}" |
241 | | - Tag="{TemplateBinding chelper:ControlHelper.CornerRadius}" /> |
| 219 | + Tag="{TemplateBinding chelper:ControlHelper.CornerRadius}"/> |
242 | 220 | </Grid> |
| 221 | + |
243 | 222 | <ControlTemplate.Triggers> |
244 | | - <MultiTrigger> |
| 223 | + <MultiTrigger> |
245 | 224 | <MultiTrigger.Conditions> |
246 | 225 | <Condition Property="IsExpanded" Value="true" /> |
247 | 226 | <Condition Property="ExpandDirection" Value="Down" /> |
|
277 | 256 | <Setter TargetName="ExpanderHeader" Property="chelper:ControlHelper.CornerRadius" Value="{Binding Tag, ElementName=ExpanderHeader, Converter={StaticResource RightCornerRadiusFilterConverter}}" /> |
278 | 257 | </MultiTrigger.Setters> |
279 | 258 | </MultiTrigger> |
| 259 | + |
280 | 260 | </ControlTemplate.Triggers> |
281 | 261 | </ControlTemplate> |
282 | 262 | </Setter.Value> |
|
0 commit comments