forked from project-sbc/Power-Control-Panel-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuickAccessMenu.xaml
More file actions
136 lines (120 loc) · 7.05 KB
/
Copy pathQuickAccessMenu.xaml
File metadata and controls
136 lines (120 loc) · 7.05 KB
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
<mah:MetroWindow x:Class="Power_Control_Panel.QuickAccessMenu"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:viewModels="clr-namespace:Power_Control_Panel.PowerControlPanel.Classes.VMQAM"
xmlns:navigation="clr-namespace:Power_Control_Panel.PowerControlPanel.Classes.Navigation"
xmlns:classes="clr-namespace:Power_Control_Panel.PowerControlPanel.Classes"
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
UseNoneWindowStyle="True"
ResizeMode="CanResizeWithGrip"
Topmost="True"
Title="Power Control Panel" Height="600" Width="530" Closing="MetroWindow_Closing" MinWidth="450" MinHeight="350" Loaded="MetroWindow_Loaded">
<controls:MetroWindow.DataContext>
<viewModels:SVM />
</controls:MetroWindow.DataContext>
<controls:MetroWindow.LeftWindowCommands>
<controls:WindowCommands ShowSeparators="False">
<Button x:Name="GoBackButton"
Width="{Binding ElementName=HamburgerMenuControl, Path=CompactPaneLength}"
AutomationProperties.Name="Go back"
Click="GoBack_OnClick">
<controls:FontIcon AutomationProperties.Name="Go back icon"
FontSize="14"
Glyph="" />
</Button>
</controls:WindowCommands>
</controls:MetroWindow.LeftWindowCommands>
<controls:MetroWindow.Resources>
<DataTemplate x:Key="MenuItemTemplate" DataType="{x:Type viewModels:MI}">
<Grid Height="48">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type controls:HamburgerMenu}}, Path=CompactPaneLength, Mode=OneWay}" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ContentControl Grid.Column="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Content="{Binding Icon}"
Focusable="False" />
<TextBlock Grid.Column="1"
VerticalAlignment="Center"
FontSize="16"
Text="{Binding Label}" />
</Grid>
</DataTemplate>
<Storyboard x:Key="NavigationStoryboard">
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetProperty="(UIElement.Opacity)">
<SplineDoubleKeyFrame KeyTime="00:00:00"
Value="0" />
<SplineDoubleKeyFrame KeyTime="00:00:00.150"
Value="1" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)">
<SplineDoubleKeyFrame KeyTime="00:00:00"
Value="200" />
<SplineDoubleKeyFrame KeySpline="0.1, 0.9, 0.2, 1"
KeyTime="00:00:00.300"
Value="0" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Style BasedOn="{StaticResource {x:Type Frame}}"
TargetType="{x:Type Frame}">
<Setter Property="navigation:FrameAnimator.FrameNavigationStoryboard"
Value="{StaticResource NavigationStoryboard}" />
<Setter Property="RenderTransform">
<Setter.Value>
<TranslateTransform />
</Setter.Value>
</Setter>
<Setter Property="Background"
Value="{DynamicResource MahApps.Brushes.Accent4}" />
<Setter Property="ClipToBounds"
Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Frame}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Padding="{TemplateBinding Padding}">
<ContentPresenter x:Name="PART_FrameCP">
<ContentPresenter.RenderTransform>
<TranslateTransform />
</ContentPresenter.RenderTransform>
</ContentPresenter>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</controls:MetroWindow.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="39" />
<RowDefinition/>
</Grid.RowDefinitions>
<DockPanel Grid.Row="0" >
<DockPanel.Background>
<SolidColorBrush Color="{DynamicResource {x:Static SystemColors.ControlDarkDarkColorKey}}"/>
</DockPanel.Background>
<Image x:Name="icon" DockPanel.Dock="Right"/>
<TextBlock Name="txtblkInternet" FontFamily="Segoe MDL2 Assets" Text="" VerticalAlignment="Center" Foreground="White" DockPanel.Dock="Right" FontSize="25" Margin="0,0,10,0" />
<TextBlock Name="txtblkPower" FontFamily="Segoe MDL2 Assets" Text="" VerticalAlignment="Center" Foreground="White" DockPanel.Dock="Right" FontSize="30" Margin="0,0,10,0" />
<TextBlock Name="txtblkBatteryPercentage" Text="" TextAlignment="Right" Foreground="White" VerticalAlignment="Center" DockPanel.Dock="Right" FontSize="22" Margin="0,0,10,0" />
<TextBlock Name="txtblkGamepad" FontFamily="Segoe MDL2 Assets" Text="" TextAlignment="Right" VerticalAlignment="Center" Foreground="White" DockPanel.Dock="Right" FontSize="25" Margin="0,0,10,0" />
<TextBlock Name="txtblkDateTime" Text="" TextAlignment="Right" Foreground="White" VerticalAlignment="Center" DockPanel.Dock="Right" FontSize="22" Margin="0,0,10,0" />
</DockPanel>
<controls:HamburgerMenu Grid.Row="1" x:Name="HamburgerMenuControl"
DisplayMode="CompactInline"
IsPaneOpen="False"
ItemInvoked="HamburgerMenuControl_OnItemInvoked"
ItemTemplate="{StaticResource MenuItemTemplate}"
ItemsSource="{Binding Menu}"
OptionsItemTemplate="{StaticResource MenuItemTemplate}"
OptionsItemsSource="{Binding OptionsMenu}" />
</Grid>
</mah:MetroWindow>