8ada549777
Introduces a comprehensive conditional process profile system, including new models, service interfaces, and implementations for dynamic profile application based on system state and process conditions. Enhances logging with correlation tracking, improves CPU topology detection with caching, and extends game detection with ML-like features and performance metrics. Updates various view models and process models to support new features and optimizations.
243 lines
13 KiB
XML
243 lines
13 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="LightGray"
|
|
BorderBrush="Gray"
|
|
BorderThickness="1"
|
|
CornerRadius="10"
|
|
Height="20"
|
|
Width="40">
|
|
<Grid>
|
|
<Ellipse x:Name="Thumb"
|
|
Width="16"
|
|
Height="16"
|
|
Fill="White"
|
|
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="#0078D4"/>
|
|
<Setter TargetName="Thumb" Property="Fill" Value="White"/>
|
|
<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="#E0E0E0"/>
|
|
<Setter TargetName="Border" Property="BorderBrush" Value="#C0C0C0"/>
|
|
<Setter TargetName="Thumb" Property="Fill" Value="#A0A0A0"/>
|
|
<Setter TargetName="Border" Property="Opacity" Value="0.6"/>
|
|
</Trigger>
|
|
<Trigger Property="IsMouseOver" Value="True">
|
|
<Setter TargetName="Border" Property="BorderBrush" Value="#0078D4"/>
|
|
</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 & 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="Gray"
|
|
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="#2E3440"/>
|
|
</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="Gray"
|
|
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="Green"/>
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsAvailable}" Value="False">
|
|
<Setter Property="Fill" Value="Red"/>
|
|
</DataTrigger>
|
|
<DataTrigger Binding="{Binding IsEnabled}" Value="False">
|
|
<Setter Property="Fill" Value="Gray"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</Ellipse.Style>
|
|
</Ellipse>
|
|
|
|
<TextBlock FontSize="11"
|
|
Foreground="Gray"
|
|
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="Red"
|
|
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>
|