This repository was archived by the owner on Sep 29, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
219 lines (209 loc) · 13.2 KB
/
MainWindow.xaml
File metadata and controls
219 lines (209 loc) · 13.2 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
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
<Window
x:Class="AutoPowerTimeOut.MainWindow"
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:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:local="clr-namespace:AutoPowerTimeOut"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
x:Name="Window"
Title="Auto Power Timeout"
Width="800"
Height="450"
ui:ThemeManager.IsThemeAware="True"
ui:ThemeManager.RequestedTheme="Default"
ui:TitleBar.ExtendViewIntoTitleBar="True"
ui:TitleBar.Height="48"
ui:WindowHelper.SystemBackdropType="Mica"
ui:WindowHelper.UseModernWindowStyle="True"
Closing="Window_Closing"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{Binding ElementName=Window, Path=(ui:TitleBar.Height)}" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<Image
x:Name="AppImage"
Width="20"
Margin="20,4,0,0"
RenderOptions.BitmapScalingMode="HighQuality" />
<TextBlock
x:Name="AppTitleText"
Margin="12,4,0,0"
VerticalAlignment="Center"
FontWeight="Bold"
Style="{DynamicResource CaptionTextBlockStyle}"
Text="Auto Power Time-out"
TextWrapping="NoWrap" />
<TextBlock
Margin="12,4,0,0"
VerticalAlignment="Center"
Style="{DynamicResource CaptionTextBlockStyle}"
Text="{Binding FileVersion}"
TextWrapping="NoWrap" />
</StackPanel>
<ui:ScrollViewerEx Grid.Row="1">
<ikw:SimpleStackPanel Margin="16,0,16,16" Spacing="4">
<ui:SettingsExpander Description="Choose what happens when your device is idle for a specified time" Header="Screen, sleep & hibernate time-outs">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Glyph="" />
</ui:SettingsExpander.HeaderIcon>
<ui:SettingsExpander.ItemsHeader>
<ikw:SimpleStackPanel Spacing="1">
<Border Background="{DynamicResource SettingsCardBackground}">
<ikw:SimpleStackPanel Margin="8,12,8,12" Spacing="2">
<TextBlock
Margin="4"
VerticalAlignment="Center"
FontSize="14"
FontWeight="Bold"
Foreground="{ui:ThemeResource {x:Static ui:ThemeKeys.TextFillColorPrimaryBrushKey}}"
Text="Plugged in" />
<ui:SettingsCard Description="Turn off the screen after 5 minutes to save energy. Higher settings use more energy" Header="Turn my screen off after">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding PluggedInItemSource}"
SelectedValue="{Binding PluggedInScreen}"
SelectedValuePath="Value" />
</ui:SettingsCard>
<ui:SettingsCard Description="Turn on sleep after 5 minutes to save energy. Higher settings use more energy" Header="Make my device sleep after">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding PluggedInItemSource}"
SelectedValue="{Binding PluggedInSleep}"
SelectedValuePath="Value" />
</ui:SettingsCard>
</ikw:SimpleStackPanel>
</Border>
<Border Background="{DynamicResource SettingsCardBackground}">
<ikw:SimpleStackPanel Margin="8,8,8,12" Spacing="2">
<TextBlock
Margin="4"
VerticalAlignment="Center"
FontSize="14"
FontWeight="Bold"
Foreground="{ui:ThemeResource {x:Static ui:ThemeKeys.TextFillColorPrimaryBrushKey}}"
Text="On battery" />
<ui:SettingsCard Description="Turn off the screen after 3 minutes to save energy. Higher settings use more energy" Header="Turn my screen off after">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding OnBatteryItemSource}"
SelectedValue="{Binding OnBatteryScreen}"
SelectedValuePath="Value" />
</ui:SettingsCard>
<ui:SettingsCard Description="Turn on sleep after 3 minutes to save energy. Higher settings use more energy" Header="Make my device sleep after">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding OnBatteryItemSource}"
SelectedValue="{Binding OnBatterySleep}"
SelectedValuePath="Value" />
</ui:SettingsCard>
</ikw:SimpleStackPanel>
</Border>
<ikw:SimpleStackPanel Background="{DynamicResource SettingsCardBackground}" Spacing="4">
<StackPanel Margin="8,0,8,8" Orientation="Horizontal">
<TextBlock
Margin="4"
VerticalAlignment="Center"
FontSize="14"
FontWeight="Bold"
Foreground="{ui:ThemeResource {x:Static ui:ThemeKeys.TextFillColorPrimaryBrushKey}}"
Text="Related links" />
<ui:HyperlinkButton
Margin="4,0,4,4"
VerticalAlignment="Center"
Content="Choosing energy efficient sleep settings"
NavigateUri="https://go.microsoft.com/fwlink/?linkid=2185388" />
</StackPanel>
</ikw:SimpleStackPanel>
</ikw:SimpleStackPanel>
</ui:SettingsExpander.ItemsHeader>
</ui:SettingsExpander>
<ui:SettingsExpander Description="Choose what happens when you interact with your device's physical controls" Header="Lid, power & sleep button controls">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Glyph="" />
</ui:SettingsExpander.HeaderIcon>
<ui:SettingsExpander.ItemsHeader>
<ikw:SimpleStackPanel Spacing="1">
<Border Background="{DynamicResource SettingsCardBackground}">
<ikw:SimpleStackPanel Margin="8,12,8,12" Spacing="2">
<TextBlock
Margin="4"
VerticalAlignment="Center"
FontSize="14"
FontWeight="Bold"
Foreground="{ui:ThemeResource {x:Static ui:ThemeKeys.TextFillColorPrimaryBrushKey}}"
Text="Plugged in" />
<ui:SettingsCard Header="Pressing the power button will make my PC">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding LidPowerSleepButtonOptionItemSource}"
SelectedValue="{Binding PluggedInPowerButton}"
SelectedValuePath="Value" />
</ui:SettingsCard>
<ui:SettingsCard Header="Pressing the sleep button will make my PC">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding LidPowerSleepButtonOptionItemSource}"
SelectedValue="{Binding PluggedInSleepButton}"
SelectedValuePath="Value" />
</ui:SettingsCard>
<ui:SettingsCard Header="Closing the lid will make my PC">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding LidPowerSleepButtonOptionItemSource}"
SelectedValue="{Binding PluggedInLidButton}"
SelectedValuePath="Value" />
</ui:SettingsCard>
</ikw:SimpleStackPanel>
</Border>
<Border Background="{DynamicResource SettingsCardBackground}">
<ikw:SimpleStackPanel Margin="8,8,8,12" Spacing="2">
<TextBlock
Margin="4"
VerticalAlignment="Center"
FontSize="14"
FontWeight="Bold"
Foreground="{ui:ThemeResource {x:Static ui:ThemeKeys.TextFillColorPrimaryBrushKey}}"
Text="On battery" />
<ui:SettingsCard Header="Pressing the power button will make my PC">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding LidPowerSleepButtonOptionItemSource}"
SelectedValue="{Binding OnBatteryPowerButton}"
SelectedValuePath="Value" />
</ui:SettingsCard>
<ui:SettingsCard Header="Pressing the sleep button will make my PC">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding LidPowerSleepButtonOptionItemSource}"
SelectedValue="{Binding OnBatterySleepButton}"
SelectedValuePath="Value" />
</ui:SettingsCard>
<ui:SettingsCard Header="Closing the lid will make my PC">
<ComboBox
DisplayMemberPath="Display"
ItemsSource="{Binding LidPowerSleepButtonOptionItemSource}"
SelectedValue="{Binding OnBatteryLidButton}"
SelectedValuePath="Value" />
</ui:SettingsCard>
</ikw:SimpleStackPanel>
</Border>
</ikw:SimpleStackPanel>
</ui:SettingsExpander.ItemsHeader>
</ui:SettingsExpander>
<ui:SettingsCard Header="Show notifications when power settings have been updated">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch IsOn="{Binding ShowNotifications, Mode=TwoWay}" />
</ui:SettingsCard>
</ikw:SimpleStackPanel>
</ui:ScrollViewerEx>
</Grid>
</Window>