-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathform.xaml
148 lines (130 loc) · 6.69 KB
/
form.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
<controls:MetroWindow
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Name="MainPanel" MaxHeight="768" MaxWidth="1024" WindowStartupLocation="CenterScreen" >
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="resources\Icons.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Grid>
<Grid.Resources>
<DataTemplate x:Key="MenuItemTemplate" DataType="{x:Type controls:HamburgerMenuIconItem}">
<Grid Height="48">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ContentControl Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<Rectangle Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center">
<Rectangle.Fill>
<VisualBrush Stretch="Fill" Visual="{Binding Icon}" />
</Rectangle.Fill>
</Rectangle>
</ContentControl>
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
FontSize="16"
Foreground="White"
Text="{Binding Label}" />
</Grid>
</DataTemplate>
<DataTemplate x:Key="OptionsMenuItemTemplate" DataType="{x:Type controls:HamburgerMenuIconItem}">
<Grid Height="48">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="48" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ContentControl Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center">
<Rectangle Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center">
<Rectangle.Fill>
<VisualBrush Stretch="Fill" Visual="{Binding Icon}" />
</Rectangle.Fill>
</Rectangle>
</ContentControl>
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
FontSize="16"
Foreground="White"
Text="{Binding Label}" />
</Grid>
</DataTemplate>
</Grid.Resources>
<controls:HamburgerMenu x:Name="HamburgerMenuControl"
Foreground="White"
PaneBackground="#FF444444"
IsPaneOpen="False"
ItemTemplate="{StaticResource MenuItemTemplate}"
OptionsItemTemplate="{StaticResource OptionsMenuItemTemplate}"
DisplayMode="CompactInline"
>
<!-- Items -->
<controls:HamburgerMenu.ItemsSource>
<controls:HamburgerMenuItemCollection>
<controls:HamburgerMenuIconItem Icon="{StaticResource appbar_home_variant}"
Label="Event">
<controls:HamburgerMenuIconItem.Tag>
<Grid x:Name="ControlView"></Grid>
</controls:HamburgerMenuIconItem.Tag>
</controls:HamburgerMenuIconItem>
<controls:HamburgerMenuIconItem Icon="{StaticResource appbar_people_status}"
Label="Internal Dialog Function">
<controls:HamburgerMenuIconItem.Tag>
<Grid x:Name="InternalView"></Grid>
</controls:HamburgerMenuIconItem.Tag>
</controls:HamburgerMenuIconItem>
<controls:HamburgerMenuIconItem Icon="{StaticResource appbar_cog}"
Label="External Dialog Function">
<controls:HamburgerMenuIconItem.Tag>
<Grid x:Name="ExternalView"></Grid>
</controls:HamburgerMenuIconItem.Tag>
</controls:HamburgerMenuIconItem>
</controls:HamburgerMenuItemCollection>
</controls:HamburgerMenu.ItemsSource>
<!-- Options -->
<controls:HamburgerMenu.OptionsItemsSource>
<controls:HamburgerMenuItemCollection>
<controls:HamburgerMenuIconItem Icon="{StaticResource appbar_information_circle}"
Label="About">
<controls:HamburgerMenuIconItem.Tag>
<Grid x:Name="AboutView"></Grid>
</controls:HamburgerMenuIconItem.Tag>
</controls:HamburgerMenuIconItem>
</controls:HamburgerMenuItemCollection>
</controls:HamburgerMenu.OptionsItemsSource>
<!-- Content -->
<controls:HamburgerMenu.ContentTemplate>
<DataTemplate DataType="{x:Type controls:HamburgerMenuItem}">
<Grid x:Name="TheContentGrid">
<Grid.RowDefinitions>
<RowDefinition Height="48" />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0"
Background="#FF444444">
<TextBlock x:Name="Header"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="24"
Foreground="White"
Text="{Binding Label}" />
</Border>
<ContentControl x:Name="TheContent"
Grid.Row="1"
Focusable="False"
Foreground="{DynamicResource BlackBrush}"
Content="{Binding Tag}" />
</Grid>
</DataTemplate>
</controls:HamburgerMenu.ContentTemplate>
</controls:HamburgerMenu>
</Grid>
</controls:MetroWindow>