This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathExpanderStyles.xaml
127 lines (108 loc) · 3.39 KB
/
ExpanderStyles.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes">
<ControlTemplate
x:Key="XivToolsExpanderTemplate"
TargetType="{x:Type Expander}">
<Grid KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="26" />
</Grid.ColumnDefinitions>
<ContentPresenter
Grid.Row="0"
Grid.Column="0"
Margin="{TemplateBinding Padding}"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding ContentTemplate}" />
<Rectangle
x:Name="ExpandPutty"
Grid.Row="0"
Grid.Column="1"
Height="8"
Margin="2,0,0,-2"
HorizontalAlignment="Stretch"
VerticalAlignment="Bottom"
Fill="{DynamicResource ControlBackgroundBrush}"
Visibility="Collapsed" />
<ToggleButton
x:Name="HeaderSite"
Grid.Row="0"
Grid.Column="1"
Margin="2,0,0,0"
Foreground="{TemplateBinding Foreground}"
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{DynamicResource XivToolsToggleButton}">
<Path
Margin="3"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 0,0 5,3 10,0"
Stroke="{DynamicResource ForegroundLightBrush}"
StrokeThickness="1" />
</ToggleButton>
<Grid
x:Name="ExpandArea"
Grid.Row="1"
Grid.ColumnSpan="2"
Margin="0,2,0,0"
IsEnabled="False"
IsHitTestVisible="False">
<Grid.LayoutTransform>
<ScaleTransform x:Name="ExpandScale" ScaleY="0" />
</Grid.LayoutTransform>
<Border
BorderBrush="{DynamicResource ControlBackgroundBrush}"
BorderThickness="1"
CornerRadius="6,0,6,6"
SnapsToDevicePixels="true">
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Focusable="false" />
</Border>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter TargetName="ExpandArea" Property="IsHitTestVisible" Value="True" />
<Setter TargetName="ExpandArea" Property="IsEnabled" Value="True" />
<Setter TargetName="ExpandPutty" Property="Visibility" Value="Visible" />
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="ExpandScale"
Storyboard.TargetProperty="ScaleY"
To="1"
Duration="0:00:00.150" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="ExpandScale"
Storyboard.TargetProperty="ScaleY"
To="0"
Duration="0:00:00.150" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style
x:Key="XivToolsExpander"
TargetType="{x:Type Expander}">
<Setter Property="Template" Value="{StaticResource XivToolsExpanderTemplate}" />
<Setter Property="Margin" Value="1" />
</Style>
</ResourceDictionary>