010dee679f
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.
188 lines
11 KiB
XML
188 lines
11 KiB
XML
<UserControl x:Class="ThreadPilot.Views.MasksView"
|
||
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"
|
||
mc:Ignorable="d"
|
||
d:DesignHeight="600" d:DesignWidth="900">
|
||
|
||
<Grid Margin="10">
|
||
<Grid.RowDefinitions>
|
||
<RowDefinition Height="*"/>
|
||
<RowDefinition Height="Auto"/>
|
||
</Grid.RowDefinitions>
|
||
|
||
<Grid Grid.Row="0">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="250" MinWidth="200"/>
|
||
<ColumnDefinition Width="10"/>
|
||
<ColumnDefinition Width="*" MinWidth="400"/>
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<!-- LISTA MASCHERE SINISTRA -->
|
||
<DockPanel Grid.Column="0">
|
||
<!-- Header con bottoni -->
|
||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,0,0,10">
|
||
<Button Content="➕ New" Command="{Binding CreateMaskCommand}"
|
||
Padding="10,5" FontSize="13" Margin="0,0,5,0"
|
||
ToolTip="Create a new core mask"/>
|
||
<Button Content="🗑️ Delete" Command="{Binding DeleteMaskCommand}"
|
||
Padding="10,5" FontSize="13"
|
||
ToolTip="Delete selected mask"/>
|
||
</StackPanel>
|
||
|
||
<!-- ListBox delle maschere -->
|
||
<Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" CornerRadius="4">
|
||
<ListBox ItemsSource="{Binding CoreMasks}"
|
||
SelectedItem="{Binding SelectedCoreMask, Mode=TwoWay}"
|
||
Background="{DynamicResource SurfaceBrush}"
|
||
BorderThickness="0">
|
||
<ListBox.ItemTemplate>
|
||
<DataTemplate>
|
||
<Grid Margin="5">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<StackPanel Grid.Column="0">
|
||
<TextBlock Text="{Binding Name}" FontWeight="SemiBold" FontSize="13"/>
|
||
<TextBlock Text="{Binding Description}"
|
||
FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}"
|
||
TextTrimming="CharacterEllipsis"
|
||
Margin="0,2,0,0"/>
|
||
<TextBlock FontSize="10" Foreground="{DynamicResource TextSecondaryBrush}" Margin="0,2,0,0">
|
||
<Run Text="{Binding SelectedCoreCount, Mode=OneWay}"/>
|
||
<Run Text="/"/>
|
||
<Run Text="{Binding BoolMask.Count, Mode=OneWay}"/>
|
||
<Run Text="cores"/>
|
||
</TextBlock>
|
||
</StackPanel>
|
||
|
||
<TextBlock Grid.Column="1"
|
||
Text="⭐" FontSize="14"
|
||
VerticalAlignment="Center"
|
||
Margin="5,0,0,0">
|
||
<TextBlock.Style>
|
||
<Style TargetType="TextBlock">
|
||
<Setter Property="Visibility" Value="Collapsed"/>
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding IsDefault}" Value="True">
|
||
<Setter Property="Visibility" Value="Visible"/>
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</TextBlock.Style>
|
||
</TextBlock>
|
||
</Grid>
|
||
</DataTemplate>
|
||
</ListBox.ItemTemplate>
|
||
</ListBox>
|
||
</Border>
|
||
</DockPanel>
|
||
|
||
<!-- DIVIDER -->
|
||
<GridSplitter Grid.Column="1" Width="10" HorizontalAlignment="Stretch" Background="Transparent"/>
|
||
|
||
<!-- EDITOR MASK DESTRA -->
|
||
<ScrollViewer Grid.Column="2" VerticalScrollBarVisibility="Auto">
|
||
<StackPanel Margin="10,0,0,0">
|
||
<StackPanel.Style>
|
||
<Style TargetType="StackPanel">
|
||
<Setter Property="IsEnabled" Value="True"/>
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding SelectedCoreMask}" Value="{x:Null}">
|
||
<Setter Property="IsEnabled" Value="False"/>
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</StackPanel.Style>
|
||
|
||
<!-- Nome e Descrizione -->
|
||
<GroupBox Header="Mask Information" Padding="10" Margin="0,0,0,15">
|
||
<StackPanel>
|
||
<TextBlock Text="Name:" FontWeight="SemiBold" Margin="0,0,0,5"/>
|
||
<TextBox Text="{Binding SelectedCoreMask.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||
Padding="8,6" FontSize="13" Margin="0,0,0,10"/>
|
||
|
||
<TextBlock Text="Description:" FontWeight="SemiBold" Margin="0,0,0,5"/>
|
||
<TextBox Text="{Binding SelectedCoreMask.Description, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||
Padding="8,6" Height="60" TextWrapping="Wrap" AcceptsReturn="True"
|
||
VerticalScrollBarVisibility="Auto"/>
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<!-- Core Selection Grid -->
|
||
<GroupBox Header="Select CPU Cores" Padding="10" Margin="0,0,0,15">
|
||
<StackPanel>
|
||
<!-- Core Checkboxes - Direct binding to BoolMask like CPUSetSetter -->
|
||
<TextBlock Text="Click checkboxes to toggle cores. Changes are saved automatically."
|
||
FontSize="11" Foreground="{DynamicResource TextSecondaryBrush}" Margin="0,0,0,10"/>
|
||
<ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="300">
|
||
<ItemsControl x:Name="CoreItemsControl" ItemsSource="{Binding CoreBits}">
|
||
<ItemsControl.ItemsPanel>
|
||
<ItemsPanelTemplate>
|
||
<WrapPanel Orientation="Horizontal" MaxWidth="600"/>
|
||
</ItemsPanelTemplate>
|
||
</ItemsControl.ItemsPanel>
|
||
<ItemsControl.ItemTemplate>
|
||
<DataTemplate>
|
||
<Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1"
|
||
Margin="2" Padding="4" CornerRadius="3">
|
||
<Border.Style>
|
||
<Style TargetType="Border">
|
||
<Setter Property="Background" Value="{DynamicResource SurfaceBrush}"/>
|
||
<Style.Triggers>
|
||
<DataTrigger Binding="{Binding IsSelected}" Value="True">
|
||
<Setter Property="Background" Value="{DynamicResource InfoBackgroundBrush}"/>
|
||
</DataTrigger>
|
||
</Style.Triggers>
|
||
</Style>
|
||
</Border.Style>
|
||
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||
FontSize="10" MinWidth="60">
|
||
<CheckBox.Content>
|
||
<TextBlock>
|
||
<Run Text="Core "/>
|
||
<Run Text="{Binding Index, Mode=OneWay}"/>
|
||
</TextBlock>
|
||
</CheckBox.Content>
|
||
</CheckBox>
|
||
</Border>
|
||
</DataTemplate>
|
||
</ItemsControl.ItemTemplate>
|
||
</ItemsControl>
|
||
</ScrollViewer>
|
||
</StackPanel>
|
||
</GroupBox>
|
||
|
||
<!-- Actions -->
|
||
<GroupBox Header="Actions" Padding="10">
|
||
<StackPanel>
|
||
<Button Content="📋 Duplicate Mask" Command="{Binding DuplicateMaskCommand}"
|
||
HorizontalAlignment="Left" Padding="10,6" Margin="0,0,0,5"/>
|
||
|
||
<CheckBox Content="Set as Default Mask"
|
||
IsChecked="{Binding SelectedCoreMask.IsDefault, Mode=TwoWay}"
|
||
Margin="0,10,0,5"
|
||
ToolTip="The default mask is applied to new processes"/>
|
||
|
||
<CheckBox Content="Enabled"
|
||
IsChecked="{Binding SelectedCoreMask.IsEnabled, Mode=TwoWay}"
|
||
Margin="0,5"
|
||
ToolTip="Disable to temporarily hide this mask"/>
|
||
</StackPanel>
|
||
</GroupBox>
|
||
</StackPanel>
|
||
</ScrollViewer>
|
||
</Grid>
|
||
|
||
<!-- Status Bar -->
|
||
<Border Grid.Row="1" Background="{DynamicResource SurfaceAltBrush}" Padding="10,5" Margin="0,10,0,0" CornerRadius="3">
|
||
<TextBlock Text="{Binding StatusMessage}"
|
||
FontSize="12" Foreground="{DynamicResource TextSecondaryBrush}"
|
||
TextTrimming="CharacterEllipsis"/>
|
||
</Border>
|
||
</Grid>
|
||
</UserControl>
|