-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMenu.xaml
226 lines (208 loc) · 14.4 KB
/
Menu.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Firefly.Wpf.MenuDemo"
xmlns:local1="clr-namespace:Firefly.Wpf.MenuDemo"
mc:Ignorable="d"
x:Class="Firefly.Wpf.MenuDemo.Menu"
x:Name="UserControl" d:DesignHeight="480" Width="327">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ResourceDictionary1.xaml"/>
<ResourceDictionary>
<DataTemplate DataType="{x:Type local:SubMenu}">
<Button x:Name="SubMenuButton" Style="{DynamicResource SubMenuButton}" Content="{Binding Name}" Height="40" Margin="5,5,5,5" Click="SubMenuButton_Click" Command="{Binding Select}">
</Button>
</DataTemplate>
<DataTemplate DataType="{x:Type local:MenuButton}">
<Button Style="{DynamicResource ButtonStyle1}" Content="{Binding Name}" Height="40" Margin="5,5,5,5" Command="{Binding Command}"/>
</DataTemplate>
<DataTemplate DataType="{x:Type local:AnotherTypeOfSubMenu}">
<Grid x:Name="LayoutRoot" Height="40" Margin="5,5,5,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="0.2*"/>
</Grid.ColumnDefinitions>
<Button x:Name="SubMenuButton" Style="{DynamicResource SubMenu}" Grid.Column="1" Click="SubMenuButton_Click" Command="{Binding Select}" />
<Button x:Name="ClickButton" Content="{Binding Path=Name}" Style="{DynamicResource ButtonMEnu}" Command="{Binding Command}"/>
</Grid>
</DataTemplate>
<Storyboard x:Key="EnterChild">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="-330"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild2">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="330"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="LeaveChild">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="330"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild2">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="660"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="EnterChild2">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="-660"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="-330"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild2">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="LeaveChild2">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutRoot">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="330"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild2">
<SplineDoubleKeyFrame KeyTime="0:0:0.3" Value="330"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="Init">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild">
<SplineDoubleKeyFrame KeyTime="0" Value="330"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="LayoutChild2">
<SplineDoubleKeyFrame KeyTime="0" Value="660"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<UserControl.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource Init}"/>
</EventTrigger>
</UserControl.Triggers>
<UserControl.DataContext>
<local:TheMenu/>
</UserControl.DataContext>
<Border Background="{DynamicResource lightBluePatternedBackground}" CornerRadius="20" Grid.RowSpan="3" ClipToBounds="True">
<Grid>
<Grid x:Name="LayoutRoot" ClipToBounds="True" RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Grid.RenderTransform>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="0.875*"/>
<RowDefinition Height="12"/>
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="1">
<ItemsControl Grid.Row="1" ItemsSource="{Binding Menues}" />
</ScrollViewer>
<Path Data="M20.000002,4.5474735E-13 L307,4.5474735E-13 C318.04568,-2.4288888E-06 327,8.9543023 327,19.999998 L327,23.499999 327,24.159997 327,44.159994 307,44.159994 20.000002,44.159994 0,44.159994 0,24.159997 0,23.499999 0,19.999998 C0,8.9543023 8.9543047,-2.4288888E-06 20.000002,4.5474735E-13 z"
Stretch="Fill">
<Path.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFB0BCCD" Offset="0"/>
<GradientStop Color="#FF6D84A2" Offset="1"/>
</LinearGradientBrush>
</Path.Fill>
</Path>
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" x:Name= "menuName" VerticalAlignment="Center" FontSize="18" Foreground="White"/>
<Rectangle Fill="#FF2D3642" Height="1" VerticalAlignment="Bottom"/>
</Grid>
<Grid x:Name="LayoutChild" ClipToBounds="True" RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform X="0"/>
</TransformGroup>
</Grid.RenderTransform>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="0.875*"/>
<RowDefinition Height="12"/>
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="1">
<ItemsControl Grid.Row="1" ItemsSource="{Binding CurrentMenu.Items}" />
</ScrollViewer>
<Path Data="M20.000002,4.5474735E-13 L307,4.5474735E-13 C318.04568,-2.4288888E-06 327,8.9543023 327,19.999998 L327,23.499999 327,24.159997 327,44.159994 307,44.159994 20.000002,44.159994 0,44.159994 0,24.159997 0,23.499999 0,19.999998 C0,8.9543023 8.9543047,-2.4288888E-06 20.000002,4.5474735E-13 z"
Stretch="Fill">
<Path.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFB0BCCD" Offset="0"/>
<GradientStop Color="#FF6D84A2" Offset="1"/>
</LinearGradientBrush>
</Path.Fill>
</Path>
<Rectangle Fill="#FF2D3642" Height="1" VerticalAlignment="Bottom"/>
<Button x:Name="backButton" HorizontalAlignment="Left" Margin="6.333,8,0,8" Width="37.667" BorderBrush="#FF546782" Foreground="White" Click="backButton_Click">
<Button.Background>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FF8EA4C1" Offset="0"/>
<GradientStop Color="#FF5877A2" Offset="0.5"/>
<GradientStop Color="#FF5877A2" Offset="0.547"/>
<GradientStop Color="#FF4A6C9B" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding CurrentMenu.Name}" VerticalAlignment="Center" FontSize="18" Foreground="White"/>
</Grid>
<Grid x:Name="LayoutChild2" ClipToBounds="True" RenderTransformOrigin="0.5,0.5">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform X="0"/>
</TransformGroup>
</Grid.RenderTransform>
<Grid.RowDefinitions>
<RowDefinition Height="40"/>
<RowDefinition Height="0.875*"/>
<RowDefinition Height="12"/>
</Grid.RowDefinitions>
<ScrollViewer Grid.Row="1">
<ItemsControl Grid.Row="1" ItemsSource="{Binding CurrentChildMenu.Items}" />
</ScrollViewer>
<Path Data="M20.000002,4.5474735E-13 L307,4.5474735E-13 C318.04568,-2.4288888E-06 327,8.9543023 327,19.999998 L327,23.499999 327,24.159997 327,44.159994 307,44.159994 20.000002,44.159994 0,44.159994 0,24.159997 0,23.499999 0,19.999998 C0,8.9543023 8.9543047,-2.4288888E-06 20.000002,4.5474735E-13 z"
Stretch="Fill">
<Path.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFB0BCCD" Offset="0"/>
<GradientStop Color="#FF6D84A2" Offset="1"/>
</LinearGradientBrush>
</Path.Fill>
</Path>
<Rectangle Fill="#FF2D3642" Height="1" VerticalAlignment="Bottom"/>
<Button x:Name="backButton2" HorizontalAlignment="Left" Margin="6.333,8,0,8" Width="37.667" BorderBrush="#FF546782" Foreground="White" Click="backButton_Click">
<Button.Background>
<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
<GradientStop Color="#FF8EA4C1" Offset="0"/>
<GradientStop Color="#FF5877A2" Offset="0.5"/>
<GradientStop Color="#FF5877A2" Offset="0.547"/>
<GradientStop Color="#FF4A6C9B" Offset="1"/>
</LinearGradientBrush>
</Button.Background>
</Button>
<TextBlock HorizontalAlignment="Center" TextWrapping="Wrap" Text="{Binding CurrentChildMenu.Name}" VerticalAlignment="Center" FontSize="18" Foreground="White"/>
</Grid>
</Grid>
</Border>
</UserControl>