-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
248 lines (231 loc) Β· 13.4 KB
/
MainWindow.xaml
File metadata and controls
248 lines (231 loc) Β· 13.4 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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<ui:FluentWindow x:Class="ThreadPilot.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:ThreadPilot"
xmlns:views="clr-namespace:ThreadPilot.Views"
xmlns:viewModels="clr-namespace:ThreadPilot.ViewModels"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
mc:Ignorable="d"
ExtendsContentIntoTitleBar="True"
WindowBackdropType="Mica"
Title="ThreadPilot - Process & Power Plan Manager"
Height="864"
Width="1280"
WindowStartupLocation="CenterScreen"
UseLayoutRounding="True"
SnapsToDevicePixels="True"
KeyboardNavigation.TabNavigation="Cycle"
KeyboardNavigation.ControlTabNavigation="Cycle">
<ui:FluentWindow.Resources>
<!-- Loading Spinner Animation -->
<Storyboard x:Key="SpinnerAnimation" RepeatBehavior="Forever">
<DoubleAnimation Storyboard.TargetName="SpinnerRotation"
Storyboard.TargetProperty="Angle"
From="0" To="360" Duration="0:0:1"/>
</Storyboard>
<!-- Fade In Animation -->
<Storyboard x:Key="FadeInAnimation">
<DoubleAnimation Storyboard.TargetName="LoadingOverlay"
Storyboard.TargetProperty="Opacity"
From="0" To="1" Duration="0:0:0.2"/>
</Storyboard>
<!-- Fade Out Animation -->
<Storyboard x:Key="FadeOutAnimation">
<DoubleAnimation Storyboard.TargetName="LoadingOverlay"
Storyboard.TargetProperty="Opacity"
From="1" To="0" Duration="0:0:0.3"/>
<DoubleAnimation Storyboard.TargetName="BackdropBlur"
Storyboard.TargetProperty="Radius"
From="10" To="0" Duration="0:0:0.3"/>
<DoubleAnimation Storyboard.TargetName="AppContentLayer"
Storyboard.TargetProperty="Opacity"
From="0.84" To="1" Duration="0:0:0.3"/>
</Storyboard>
</ui:FluentWindow.Resources>
<Grid>
<Grid x:Name="AppContentLayer" Opacity="0.84">
<Grid.Effect>
<BlurEffect x:Name="BackdropBlur" Radius="10"/>
</Grid.Effect>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ui:TitleBar Grid.Row="0" Title="ThreadPilot">
<ui:TitleBar.Icon>
<ui:ImageIcon Source="pack://application:,,,/ico.ico"/>
</ui:TitleBar.Icon>
</ui:TitleBar>
<Grid Grid.Row="1">
<!-- Main Application Content (NavigationView) -->
<ui:NavigationView x:Name="RootNavigation"
PaneDisplayMode="Left"
IsBackButtonVisible="Collapsed"
IsPaneOpen="False"
OpenPaneLength="180"
CompactPaneLength="52"
AutomationProperties.Name="Primary navigation">
<ui:NavigationView.Resources>
<Style TargetType="ui:NavigationViewItem">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}"/>
</Trigger>
<Trigger Property="IsActive" Value="True">
<Setter Property="Background" Value="{DynamicResource ControlFillColorSecondaryBrush}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ControlStrokeColorDefaultBrush}"/>
</Trigger>
</Style.Triggers>
</Style>
</ui:NavigationView.Resources>
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem x:Name="NavProcess" Content="Process Management" Tag="Process" TargetPageTag="Process" Click="NavMenuItem_Click">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Apps24"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem x:Name="NavMasks" Content="CPU Masks" Tag="Masks" TargetPageTag="Masks" Click="NavMenuItem_Click">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="BranchFork24"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem x:Name="NavPower" Content="Power Plans" Tag="Power" TargetPageTag="Power" Click="NavMenuItem_Click">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Power24"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem x:Name="NavRules" Content="Rules" Tag="Rules" TargetPageTag="Rules" Click="NavMenuItem_Click">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="TasksApp24"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem x:Name="NavPerf" Content="Performance" Tag="Performance" TargetPageTag="Performance" Click="NavMenuItem_Click">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="DataHistogram24"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem x:Name="NavTweaks" Content="Tweaks" Tag="Tweaks" TargetPageTag="Tweaks" Click="NavMenuItem_Click">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Wrench24"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
</ui:NavigationView.MenuItems>
<ui:NavigationView.FooterMenuItems>
<ui:NavigationViewItem x:Name="NavSettings" TargetPageTag="Settings" Content="Settings" Tag="Settings" Click="NavMenuItem_Click">
<ui:NavigationViewItem.Icon>
<ui:SymbolIcon Symbol="Settings24"/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
</ui:NavigationView.FooterMenuItems>
<ui:NavigationView.ContentOverlay>
<Grid x:Name="MainContent" Margin="10,0,10,10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Elevation Status Bar embedded inside the content scope to maintain fluid layout -->
<Border Grid.Row="0" Background="{DynamicResource WarningBackgroundBrush}" BorderBrush="{DynamicResource WarningBorderBrush}" BorderThickness="1"
Visibility="{Binding ShowElevationPrompt, Converter={StaticResource BoolToVisibilityConverter}}"
Margin="0,0,0,10" CornerRadius="4">
<Grid Margin="10,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="β οΈ" FontSize="16" VerticalAlignment="Center" Margin="0,0,10,0"/>
<TextBlock Grid.Column="1"
Text="ThreadPilot is running with limited privileges. Some features may not be available. Administrator privileges are required for full functionality."
TextWrapping="Wrap" VerticalAlignment="Center"/>
<ui:Button Grid.Column="2" Content="Request Elevation"
Command="{Binding RequestElevationCommand}"
Margin="10,0,0,0" Padding="10,5"/>
</Grid>
</Border>
<!-- Hosted Views toggled natively to retain ViewModel mapping -->
<Grid Grid.Row="1">
<views:ProcessView x:Name="ProcessManagementTab" Visibility="Visible"/>
<views:MasksView x:Name="CoreMasksTab" Visibility="Collapsed"/>
<views:PowerPlanView x:Name="PowerPlanViewControl" Visibility="Collapsed"/>
<views:ProcessPowerPlanAssociationView x:Name="AssociationView" Visibility="Collapsed"/>
<views:PerformanceView x:Name="PerformanceViewControl" Visibility="Collapsed"/>
<views:SystemTweaksView x:Name="SystemTweaksView" Visibility="Collapsed"/>
<views:SettingsView x:Name="SettingsView" Visibility="Collapsed"/>
</Grid>
</Grid>
</ui:NavigationView.ContentOverlay>
</ui:NavigationView>
</Grid>
<!-- Status Bar -->
<Border Grid.Row="2" Background="{DynamicResource CardBackgroundFillColorSecondaryBrush}" BorderThickness="0,1,0,0" BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}" Padding="10,3">
<Border.Resources>
<Style TargetType="TextBlock">
<Setter Property="FontFamily" Value="Segoe UI Variable, Segoe UI"/>
<Setter Property="FontSize" Value="12"/>
</Style>
</Border.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Text="{Binding StatusMessage}" VerticalAlignment="Center" Opacity="{Binding StatusOpacity}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="{Binding ElevationStatusText}"/>
<TextBlock Text="π"
Margin="5,0,0,0"
Visibility="{Binding IsRunningAsAdministrator, Converter={StaticResource BoolToVisibilityConverter}}"/>
</StackPanel>
</Grid>
</Border>
</Grid>
<!-- Startup Loading Overlay -->
<Grid x:Name="LoadingOverlay"
Grid.RowSpan="3"
Background="#99000000"
Visibility="Visible"
Panel.ZIndex="1000"
AutomationProperties.Name="Application startup loading overlay"
AutomationProperties.LiveSetting="Polite">
<Border Background="{DynamicResource CardBackgroundFillColorDefaultBrush}"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
BorderThickness="1"
CornerRadius="8"
Padding="30"
HorizontalAlignment="Center"
VerticalAlignment="Center"
MinWidth="300"
MaxWidth="400">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<!-- Application Icon -->
<Image x:Name="LoadingIcon"
Source="pack://application:,,,/ico.ico"
Width="64"
Height="64"
Margin="0,0,0,20"
HorizontalAlignment="Center"/>
<!-- Loading Spinner -->
<ui:ProgressRing IsIndeterminate="True" Margin="0,0,0,15" />
<TextBlock Text="{Binding InitializationStage}"
FontSize="14"
FontWeight="SemiBold"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
HorizontalAlignment="Center"
Margin="0,0,0,10"/>
<TextBlock Text="{Binding InitializationDetails}"
FontSize="12"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
HorizontalAlignment="Center"
TextWrapping="Wrap"
TextAlignment="Center"/>
</StackPanel>
</Border>
</Grid>
</Grid>
</ui:FluentWindow>