|
1 | 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
2 |
| - xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
3 |
| - |
| 2 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | + xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf" |
| 4 | + xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters"> |
| 5 | + |
| 6 | + <ResourceDictionary.MergedDictionaries> |
| 7 | + <ResourceDictionary> |
| 8 | + <converters:BrushRoundConverter x:Key="BrushRoundConverter"/> |
| 9 | + <converters:MathNegativeConverter x:Key="MathNegativeConverter"/> |
| 10 | + </ResourceDictionary> |
| 11 | + </ResourceDictionary.MergedDictionaries> |
| 12 | + |
4 | 13 | <Style x:Key="MaterialDesignTreeView" TargetType="{x:Type TreeView}">
|
5 | 14 | <Setter Property="Background" Value="Transparent"/>
|
6 | 15 | <Setter Property="BorderBrush" Value="{x:Null}"/>
|
|
164 | 173 | <RowDefinition/>
|
165 | 174 | </Grid.RowDefinitions>
|
166 | 175 | <VisualStateManager.VisualStateGroups>
|
167 |
| - <VisualStateGroup x:Name="SelectionStates"> |
| 176 | + <VisualStateGroup Name="CommonStates"> |
168 | 177 | <VisualStateGroup.Transitions>
|
169 |
| - <VisualTransition GeneratedDuration="0" To="Selected"> |
| 178 | + <VisualTransition GeneratedDuration="0:0:0.3" To="Normal"> |
170 | 179 | <VisualTransition.GeneratedEasingFunction>
|
171 |
| - <CubicEase EasingMode="EaseOut"/> |
| 180 | + <CircleEase EasingMode="EaseOut"/> |
172 | 181 | </VisualTransition.GeneratedEasingFunction>
|
173 |
| - <Storyboard> |
174 |
| - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="SelectedBorder"> |
175 |
| - <EasingDoubleKeyFrame KeyTime="0" Value="0"/> |
176 |
| - <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/> |
177 |
| - </DoubleAnimationUsingKeyFrames> |
178 |
| - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectedBorder"> |
179 |
| - <EasingDoubleKeyFrame KeyTime="0" Value="0"/> |
180 |
| - <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/> |
181 |
| - </DoubleAnimationUsingKeyFrames> |
182 |
| - </Storyboard> |
183 |
| - </VisualTransition> |
184 |
| - <VisualTransition GeneratedDuration="0" To="Unselected"> |
185 |
| - <Storyboard> |
186 |
| - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="SelectedBorder"> |
187 |
| - <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
188 |
| - <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="0"/> |
189 |
| - </DoubleAnimationUsingKeyFrames> |
190 |
| - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectedBorder"> |
191 |
| - <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
192 |
| - <EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="0"/> |
193 |
| - </DoubleAnimationUsingKeyFrames> |
194 |
| - </Storyboard> |
195 | 182 | </VisualTransition>
|
196 | 183 | </VisualStateGroup.Transitions>
|
197 |
| - <VisualState x:Name="Selected"> |
| 184 | + <VisualState Name="Normal"/> |
| 185 | + <VisualState Name="MouseOver"> |
198 | 186 | <Storyboard>
|
199 |
| - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="SelectedBorder"> |
200 |
| - <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/> |
201 |
| - </DoubleAnimationUsingKeyFrames> |
202 |
| - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectedBorder"> |
203 |
| - <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/> |
204 |
| - </DoubleAnimationUsingKeyFrames> |
| 187 | + <DoubleAnimation Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="Opacity" |
| 188 | + To="0.1" Duration="0"/> |
205 | 189 | </Storyboard>
|
206 | 190 | </VisualState>
|
207 |
| - <VisualState x:Name="Unselected"> |
| 191 | + <VisualState Name="Disabled"/> |
| 192 | + </VisualStateGroup> |
| 193 | + <VisualStateGroup x:Name="SelectionStates"> |
| 194 | + <VisualStateGroup.Transitions> |
| 195 | + <VisualTransition GeneratedDuration="0:0:0.6"/> |
| 196 | + </VisualStateGroup.Transitions> |
| 197 | + <VisualState Name="Selected"> |
208 | 198 | <Storyboard>
|
209 |
| - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="SelectedBorder"> |
210 |
| - <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/> |
211 |
| - </DoubleAnimationUsingKeyFrames> |
212 |
| - <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectedBorder"> |
213 |
| - <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/> |
214 |
| - </DoubleAnimationUsingKeyFrames> |
| 199 | + <DoubleAnimation Storyboard.TargetName="SelectedBorder" |
| 200 | + Storyboard.TargetProperty="Opacity" |
| 201 | + To="0.18" Duration="0"/> |
215 | 202 | </Storyboard>
|
216 | 203 | </VisualState>
|
| 204 | + <VisualState Name="Unselected"/> |
217 | 205 | </VisualStateGroup>
|
218 | 206 | <VisualStateGroup x:Name="ExpansionStates">
|
219 | 207 | <VisualStateGroup.Transitions>
|
|
293 | 281 | </VisualState>
|
294 | 282 | </VisualStateGroup>
|
295 | 283 | </VisualStateManager.VisualStateGroups>
|
| 284 | + |
296 | 285 | <ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"
|
297 | 286 | Style="{StaticResource MaterialDesignExpandCollapseToggleStyle}"
|
298 | 287 | Foreground="{TemplateBinding Foreground}"
|
299 | 288 | Margin="8 0 8 0"
|
300 | 289 | VerticalAlignment="Center"
|
301 | 290 | />
|
302 |
| - <Border Background="{DynamicResource MaterialDesignFlatButtonClick}" Opacity="0" RenderTransformOrigin="0.5,0.5" |
303 |
| - x:Name="SelectedBorder" |
304 |
| - Grid.Column="1" Grid.ColumnSpan="2"> |
305 |
| - <Border.RenderTransform> |
306 |
| - <TransformGroup> |
307 |
| - <ScaleTransform ScaleX="0"/> |
308 |
| - <SkewTransform/> |
309 |
| - <RotateTransform/> |
310 |
| - <TranslateTransform/> |
311 |
| - </TransformGroup> |
312 |
| - </Border.RenderTransform> |
313 |
| - </Border> |
314 |
| - <Border x:Name="MouseOverBorder" Grid.Column="1" Grid.ColumnSpan="2" /> |
| 291 | + |
| 292 | + <Border x:Name="MouseOverBorder" |
| 293 | + Grid.Column="1" Grid.ColumnSpan="2" |
| 294 | + IsHitTestVisible="False" |
| 295 | + Opacity="0" |
| 296 | + Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}"/> |
| 297 | + |
| 298 | + <Border x:Name="SelectedBorder" |
| 299 | + Grid.Column="1" Grid.ColumnSpan="2" |
| 300 | + IsHitTestVisible="False" |
| 301 | + Opacity="0" |
| 302 | + Background="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}"/> |
| 303 | + |
315 | 304 | <Grid Grid.Column="1" Grid.ColumnSpan="2" x:Name="ContentGrid" Background="Transparent">
|
316 |
| - <ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
317 |
| - Margin="{TemplateBinding Padding}"/> |
| 305 | + <wpf:Ripple Feedback="{TemplateBinding Foreground, Converter={StaticResource BrushRoundConverter}}" |
| 306 | + Focusable="False" |
| 307 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
| 308 | + HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
| 309 | + VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
| 310 | + Padding="{TemplateBinding Padding}"> |
| 311 | + <ContentPresenter x:Name="PART_Header" ContentSource="Header"/> |
| 312 | + </wpf:Ripple> |
318 | 313 | </Grid>
|
| 314 | + |
319 | 315 | <ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" RenderTransformOrigin="0,0"
|
320 | 316 | Opacity="0"
|
321 | 317 | Margin="-16 0 0 0"
|
|
337 | 333 | <Trigger Property="IsEnabled" Value="false">
|
338 | 334 | <Setter Property="Opacity" Value=".56"/>
|
339 | 335 | </Trigger>
|
340 |
| - <MultiTrigger> |
341 |
| - <MultiTrigger.Conditions> |
342 |
| - <Condition Property="IsSelected" Value="False"/> |
343 |
| - <Condition SourceName="ContentGrid" Property="IsMouseOver" Value="True"/> |
344 |
| - </MultiTrigger.Conditions> |
345 |
| - <Setter Property="Background" TargetName="MouseOverBorder" Value="{DynamicResource MaterialDesignDivider}"/> |
346 |
| - </MultiTrigger> |
347 | 336 | </ControlTemplate.Triggers>
|
348 | 337 | </ControlTemplate>
|
349 | 338 | </Setter.Value>
|
|
0 commit comments