Files
ThreadPilot/Views/SystemTweaksView.xaml
T
PrimeBuild-pc 010dee679f Add docs, themes, services and UI updates
Large changeset adding documentation, themes, converters and wiring between UI and services. Key changes:

- Rewrote .gitignore to standardize build, IDE, OS and project-specific ignores.
- Added comprehensive documentation: ADVANCED_CPU_FEATURES.md, API_REFERENCE.md, ARCHITECTURE_GUIDE.md, DEVELOPER_GUIDE.md, GAME_BOOST_VALIDATION.md, CLAUDE.md, PROJECT_STRUCTURE.md, UI_STYLE_GUIDE.md, TRADEMARK.md.
- Added theme resources (Themes/FluentLight.xaml, Themes/FluentDark.xaml) and merged FluentLight into App.xaml resource dictionary.
- Added NullToBoolConverter and registered it in App.xaml.
- Enabled a DEBUG-only console test mode in App.xaml.cs (--test flag) and guarded AllocConsole with #if DEBUG.
- Added new service/support files (AtomicFileWriter, StoragePaths, ThemeService) and numerous updates across Services (CpuTopologyService, CoreMaskService, PowerPlanService, ProcessMonitorManagerService, ProcessService, NotificationService, SystemTrayService, SystemTweaksService, EnhancedLoggingService, etc.).
- Updated many ViewModels and Views to support new functionality (CPU topology, power plan and game-boost features) and tests (Tests/TestRunner.cs).
- Added build-release.ps1 and various project metadata updates.

Overall this commit introduces documentation, theming, new converters and test/debug support, plus extensive service and UI wiring for CPU topology, process monitoring, power plans and game boost features.
2026-04-10 03:58:51 +02:00

243 lines
14 KiB
XML

<UserControl x:Class="ThreadPilot.Views.SystemTweaksView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="800">
<UserControl.Resources>
<!-- Light Theme Pill-style Toggle Button Style -->
<Style x:Key="PillToggleButtonStyle" TargetType="ToggleButton">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="Border"
Background="{DynamicResource SurfaceAltBrush}"
BorderBrush="{DynamicResource BorderBrush}"
BorderThickness="1"
CornerRadius="10"
Height="20"
Width="40">
<Grid>
<Ellipse x:Name="Thumb"
Width="16"
Height="16"
Fill="{DynamicResource SurfaceBrush}"
HorizontalAlignment="Left"
Margin="2,0,0,0"
RenderTransformOrigin="0.5,0.5">
<Ellipse.RenderTransform>
<TranslateTransform x:Name="ThumbTransform" X="0"/>
</Ellipse.RenderTransform>
</Ellipse>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource AccentBrush}"/>
<Setter TargetName="Thumb" Property="Fill" Value="{DynamicResource SurfaceBrush}"/>
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="ThumbTransform"
Storyboard.TargetProperty="X"
To="20"
Duration="0:0:0.2"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="ThumbTransform"
Storyboard.TargetProperty="X"
To="0"
Duration="0:0:0.2"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource SurfaceAltBrush}"/>
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
<Setter TargetName="Thumb" Property="Fill" Value="{DynamicResource TextSecondaryBrush}"/>
<Setter TargetName="Border" Property="Opacity" Value="0.6"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource AccentBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Header and Controls -->
<GroupBox Grid.Row="0" Header="🔧 System Tweaks &amp; Optimizations" Margin="0,0,0,10">
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Description and Refresh Button -->
<Grid Grid.Row="0" Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="Configure Windows system optimizations and performance tweaks"
FontSize="12"
Foreground="{DynamicResource TextSecondaryBrush}"
VerticalAlignment="Center"/>
<Button Grid.Column="1"
Content="🔄 Refresh All"
Command="{Binding RefreshAllTweaksCommand}"
Padding="10,5"
ToolTip="Refresh all tweak states"
IsEnabled="{Binding IsRefreshing, Converter={StaticResource InverseBooleanConverter}}"/>
</Grid>
<!-- Status Bar -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="Status:"
FontWeight="SemiBold"
VerticalAlignment="Center"/>
<TextBlock Grid.Column="1"
Text="{Binding RefreshStatusText}"
Margin="10,0"
VerticalAlignment="Center"/>
<ProgressBar Grid.Column="2"
Width="100"
Height="4"
IsIndeterminate="{Binding IsRefreshing}"
Visibility="{Binding IsRefreshing, Converter={StaticResource BooleanToVisibilityConverter}}"/>
</Grid>
</Grid>
</GroupBox>
<!-- Tweaks List -->
<ScrollViewer Grid.Row="1"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding TweakItems}"
Margin="5">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="2"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<GroupBox Margin="5" Padding="10">
<GroupBox.Header>
<!-- Enhanced Tweak Name Styling -->
<TextBlock Text="{Binding Name}"
FontSize="15"
FontWeight="Bold"
Foreground="{DynamicResource TextPrimaryBrush}"/>
</GroupBox.Header>
<!-- Main Card Content with Two-Column Layout -->
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<!-- Left Column: Content -->
<StackPanel Grid.Column="0" Margin="0,0,15,0">
<!-- Description -->
<TextBlock Text="{Binding Description}"
FontSize="11"
Foreground="{DynamicResource TextSecondaryBrush}"
TextWrapping="Wrap"
Margin="0,0,0,8"/>
<!-- Status Indicator -->
<StackPanel Orientation="Horizontal" Margin="0,0,0,5">
<Ellipse Width="8" Height="8"
VerticalAlignment="Center"
Margin="0,0,8,0">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Setter Property="Fill" Value="{DynamicResource SuccessTextBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsAvailable}" Value="False">
<Setter Property="Fill" Value="{DynamicResource ErrorTextBrush}"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsEnabled}" Value="False">
<Setter Property="Fill" Value="{DynamicResource TextSecondaryBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
<TextBlock FontSize="11"
Foreground="{DynamicResource TextSecondaryBrush}"
VerticalAlignment="Center">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Text" Value="Enabled"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsAvailable}" Value="False">
<Setter Property="Text" Value="Not Available"/>
</DataTrigger>
<DataTrigger Binding="{Binding IsEnabled}" Value="False">
<Setter Property="Text" Value="Disabled"/>
</DataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
<!-- Error Message -->
<TextBlock Text="{Binding ErrorMessage}"
FontSize="11"
Foreground="{DynamicResource ErrorTextBrush}"
TextWrapping="Wrap"
Visibility="{Binding ErrorMessage, Converter={StaticResource StringToVisibilityConverter}}"/>
</StackPanel>
<!-- Right Column: Toggle Button -->
<ToggleButton Grid.Column="1"
Style="{StaticResource PillToggleButtonStyle}"
IsChecked="{Binding IsEnabled, Mode=OneWay}"
IsEnabled="{Binding IsAvailable}"
Command="{Binding ToggleCommand}"
CommandParameter="{Binding}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Margin="10,0,10,0"/>
</Grid>
</GroupBox>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</UserControl>