Files
ThreadPilot/Views/PowerPlanView.xaml
T
PrimeBuild-pc 74922890c8 Adopt Wpf.Ui FluentWindow and revamp UI
Replace Window with Wpf.Ui FluentWindow and integrate Wpf.Ui theme dictionaries and controls; migrate main navigation from TabControl to NavigationView with TitleBar, navigation items and view visibility management, improved startup overlay with blur/fade animations, and updated status bar. Converters now resolve brushes from application resources for theming. CpuTopologyService: add Windows API (GetLogicalProcessorInformationEx) detection, richer structures, improved HT/core type heuristics, labeling and affinity presets; fallbacks and WMI usage preserved. System tray: add ApplyTheme method, custom menu font handling and related calls. NotificationService: standardize display duration via a constant. Misc: XAML/resource adjustments, minor view/viewmodel wiring, and .gitignore updated to include implementation_plan.md.
2026-04-12 01:04:58 +02:00

121 lines
5.7 KiB
XML

<UserControl x:Class="ThreadPilot.Views.PowerPlanView"
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"
xmlns:local="clr-namespace:ThreadPilot.Views"
xmlns:helpers="clr-namespace:ThreadPilot.Helpers"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
mc:Ignorable="d"
d:DesignHeight="650" d:DesignWidth="1200">
<Grid Margin="12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Margin="0,0,0,16">
<TextBlock Text="Power Plans" FontSize="24" FontWeight="SemiBold" Margin="0,0,0,4"/>
<TextBlock Text="Manage system power plans and import custom profiles" FontSize="14" Opacity="0.7"/>
</StackPanel>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="2*"/>
<ColumnDefinition Width="3*"/>
</Grid.ColumnDefinitions>
<!-- System Power Plans -->
<GroupBox Grid.Column="0"
Header="Available Power Plans"
Margin="0,0,5,0">
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Grid.Row="0"
Command="{Binding LoadPowerPlansCommand}"
Content="Refresh Plans"
HorizontalAlignment="Right"
Padding="10,5"
Margin="0,0,0,12"
ToolTip="Refresh the list of available power plans"/>
<ui:ListView Grid.Row="1"
ItemsSource="{Binding PowerPlans}"
SelectedItem="{Binding SelectedPowerPlan}"
Background="{DynamicResource ControlFillColorSecondaryBrush}"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
<ui:ListView.ItemTemplate>
<DataTemplate>
<StackPanel Margin="5">
<TextBlock Text="{Binding Name}"
FontWeight="{Binding IsActive, Converter={StaticResource BoolToFontWeightConverter}}"/>
<TextBlock Text="{Binding Guid}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
FontSize="11"/>
</StackPanel>
</DataTemplate>
</ui:ListView.ItemTemplate>
</ui:ListView>
</Grid>
</GroupBox>
<!-- Custom Power Plans -->
<GroupBox Grid.Column="1"
Header="Custom Power Plans"
Margin="5,0,0,0">
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="Available custom power plans:"
Margin="0,0,0,10"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"/>
<ui:ListView Grid.Row="1"
ItemsSource="{Binding CustomPowerPlans}"
SelectedItem="{Binding SelectedCustomPlan}"
Background="{DynamicResource ControlFillColorSecondaryBrush}"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}">
<ui:ListView.ItemTemplate>
<DataTemplate>
<StackPanel Margin="5">
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="{Binding FilePath}"
Foreground="{DynamicResource TextFillColorSecondaryBrush}"
FontSize="11"/>
</StackPanel>
</DataTemplate>
</ui:ListView.ItemTemplate>
</ui:ListView>
</Grid>
</GroupBox>
</Grid>
<!-- Action Buttons -->
<StackPanel Grid.Row="2"
Orientation="Horizontal"
Margin="0,12,0,0">
<Button Command="{Binding SetActivePlanCommand}"
Content="Set Active"
Padding="20,5"
Margin="0,0,10,0"
ToolTip="Activate the selected power plan"/>
<Button Command="{Binding ImportCustomPlanCommand}"
Content="Import Custom Plan"
Padding="20,5"
ToolTip="Import a custom power plan from file"/>
</StackPanel>
</Grid>
</UserControl>