|
1 | 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 | | - xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"> |
| 3 | + xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf" |
| 4 | + xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters" |
| 5 | + xmlns:system="clr-namespace:System;assembly=mscorlib"> |
| 6 | + |
| 7 | + <converters:MathMultipleConverter x:Key="MathMlpMultipleConverter" Operation="Multiply" /> |
4 | 8 |
|
5 | 9 | <Style x:Key="MaterialDesignExpanderToggleButton" TargetType="{x:Type ToggleButton}"> |
6 | 10 | <Setter Property="Width" Value="16"/> |
|
117 | 121 | <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility"> |
118 | 122 | <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" /> |
119 | 123 | </ObjectAnimationUsingKeyFrames> |
120 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content"> |
121 | | - <EasingDoubleKeyFrame KeyTime="0" Value="0"/> |
122 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/> |
123 | | - </DoubleAnimationUsingKeyFrames> |
124 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="PART_Content"> |
125 | | - <EasingDoubleKeyFrame KeyTime="0" Value=".5"/> |
126 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/> |
127 | | - </DoubleAnimationUsingKeyFrames> |
128 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="PART_Content"> |
129 | | - <EasingDoubleKeyFrame KeyTime="0" Value="0"/> |
130 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/> |
131 | | - </DoubleAnimationUsingKeyFrames> |
| 124 | + <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" |
| 125 | + To="1" Duration="0:0:0.3"/> |
| 126 | + <DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer" |
| 127 | + To="1" Duration="0:0:0.3"/> |
132 | 128 | </Storyboard> |
133 | 129 | </VisualTransition> |
134 | 130 | <VisualTransition GeneratedDuration="0" To="Collapsed"> |
| 131 | + <VisualTransition.GeneratedEasingFunction> |
| 132 | + <CubicEase EasingMode="EaseOut"/> |
| 133 | + </VisualTransition.GeneratedEasingFunction> |
135 | 134 | <Storyboard> |
136 | 135 | <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility"> |
137 | | - <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Collapsed}" /> |
| 136 | + <DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="{x:Static Visibility.Collapsed}" /> |
138 | 137 | </ObjectAnimationUsingKeyFrames> |
139 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content"> |
140 | | - <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
141 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/> |
142 | | - </DoubleAnimationUsingKeyFrames> |
143 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="PART_Content"> |
144 | | - <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
145 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value=".5"/> |
146 | | - </DoubleAnimationUsingKeyFrames> |
147 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="PART_Content"> |
148 | | - <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
149 | | - <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/> |
150 | | - </DoubleAnimationUsingKeyFrames> |
| 138 | + <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" |
| 139 | + To="0" Duration="0:0:0.3"/> |
| 140 | + <DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer" |
| 141 | + To="0" Duration="0:0:0.3"/> |
151 | 142 | </Storyboard> |
152 | 143 | </VisualTransition> |
153 | 144 | </VisualStateGroup.Transitions> |
154 | 145 | <VisualState x:Name="Expanded"> |
155 | 146 | <Storyboard> |
156 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content"> |
157 | | - <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
158 | | - </DoubleAnimationUsingKeyFrames> |
159 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="PART_Content"> |
160 | | - <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1"/> |
161 | | - </DoubleAnimationUsingKeyFrames> |
162 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="PART_Content"> |
163 | | - <EasingDoubleKeyFrame KeyTime="0:0:0" Value="1"/> |
164 | | - </DoubleAnimationUsingKeyFrames> |
| 147 | + <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="1" Duration="0"/> |
| 148 | + <DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer" To="1" Duration="0"/> |
165 | 149 | <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility"> |
166 | 150 | <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" /> |
167 | 151 | </ObjectAnimationUsingKeyFrames> |
168 | 152 | </Storyboard> |
169 | 153 | </VisualState> |
170 | 154 | <VisualState x:Name="Collapsed"> |
171 | 155 | <Storyboard> |
172 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content"> |
173 | | - <EasingDoubleKeyFrame KeyTime="0" Value="0"/> |
174 | | - </DoubleAnimationUsingKeyFrames> |
175 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="PART_Content"> |
176 | | - <EasingDoubleKeyFrame KeyTime="0:0:0" Value=".5"/> |
177 | | - </DoubleAnimationUsingKeyFrames> |
178 | | - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="PART_Content"> |
179 | | - <EasingDoubleKeyFrame KeyTime="0:0:0" Value="0"/> |
180 | | - </DoubleAnimationUsingKeyFrames> |
| 156 | + <DoubleAnimation Storyboard.TargetProperty="Opacity" Storyboard.TargetName="PART_Content" To="0" Duration="0"/> |
| 157 | + <DoubleAnimation Storyboard.TargetProperty="Tag" Storyboard.TargetName="ItemsScrollViewer" To="0" Duration="0"/> |
181 | 158 | <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Visibility"> |
182 | 159 | <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" /> |
183 | 160 | </ObjectAnimationUsingKeyFrames> |
|
205 | 182 | </Grid> |
206 | 183 | </Border> |
207 | 184 | <Border Grid.Row="1"> |
208 | | - <ContentPresenter Name="PART_Content" RenderTransformOrigin="0,0"> |
209 | | - <ContentPresenter.LayoutTransform> |
210 | | - <TransformGroup> |
211 | | - <ScaleTransform ScaleX="0.5" ScaleY="0" /> |
212 | | - <SkewTransform /> |
213 | | - <RotateTransform /> |
214 | | - <TranslateTransform /> |
215 | | - </TransformGroup> |
216 | | - </ContentPresenter.LayoutTransform> |
217 | | - </ContentPresenter> |
| 185 | + <ScrollViewer x:Name="ItemsScrollViewer" |
| 186 | + VerticalScrollBarVisibility="Hidden"> |
| 187 | + <ScrollViewer.Tag> |
| 188 | + <system:Double>0.0</system:Double> |
| 189 | + </ScrollViewer.Tag> |
| 190 | + <ScrollViewer.Height> |
| 191 | + <MultiBinding Converter="{StaticResource MathMlpMultipleConverter}"> |
| 192 | + <Binding ElementName="PART_Content" Path="ActualHeight"/> |
| 193 | + <Binding RelativeSource="{RelativeSource Self}" Path="Tag"/> |
| 194 | + </MultiBinding> |
| 195 | + </ScrollViewer.Height> |
| 196 | + <ContentPresenter Name="PART_Content" /> |
| 197 | + </ScrollViewer> |
218 | 198 | </Border> |
219 | 199 | </Grid> |
220 | 200 | </ControlTemplate> |
|
0 commit comments