Phase 3 缺陷修复 + 分类管理功能 + ComboBox 主题适配

缺陷修复: 日志自动滚动、StaticResource 顺序修复、ContextMenu PlacementTarget 绑定、PATH 命令支持、异常全量捕获、RefreshData 状态保留、全局崩溃日志

分类管理: 添加/编辑/删除分类,删除时工具移入全部,CategoryEditViewModel/Window

UI 修复: ComboBox 自定义模板,暗色模式弹出层/下拉项主题配色,文本绑定修复
This commit is contained in:
2026-05-09 22:53:19 +08:00
parent 71be5da54b
commit dc94d17d99
8 changed files with 424 additions and 5 deletions

View File

@@ -78,8 +78,9 @@
<Border Grid.Column="0" Background="{DynamicResource Theme.SidebarBackground}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
<RowDefinition Height="42"/>
<RowDefinition Height="45"/>
</Grid.RowDefinitions>
@@ -91,6 +92,7 @@
HorizontalAlignment="Center"/>
<ListBox Grid.Row="1"
x:Name="CategoryListBox"
ItemsSource="{Binding Categories}"
SelectedItem="{Binding SelectedCategory}"
Background="Transparent"
@@ -100,6 +102,7 @@
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Padding" Value="16,10"/>
<Setter Property="Tag" Value="{Binding DataContext, RelativeSource={RelativeSource AncestorType=Window}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
@@ -107,7 +110,18 @@
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="3,0,0,0"
Padding="{TemplateBinding Padding}">
Padding="{TemplateBinding Padding}"
Tag="{TemplateBinding Tag}">
<Border.ContextMenu>
<ContextMenu>
<MenuItem Header="编辑"
Command="{Binding PlacementTarget.Tag.EditCategoryCommand, RelativeSource={RelativeSource AncestorType=ContextMenu}}"
CommandParameter="{Binding}"/>
<MenuItem Header="删除"
Command="{Binding PlacementTarget.Tag.DeleteCategoryCommand, RelativeSource={RelativeSource AncestorType=ContextMenu}}"
CommandParameter="{Binding}"/>
</ContextMenu>
</Border.ContextMenu>
<TextBlock Text="{Binding Name}"
Foreground="{DynamicResource Theme.Foreground}"
FontSize="14"/>
@@ -128,7 +142,24 @@
</ListBox.ItemContainerStyle>
</ListBox>
<!-- 分类管理按钮 -->
<Button Grid.Row="2"
Command="{Binding AddCategoryCommand}"
Background="Transparent"
BorderThickness="1"
BorderBrush="{DynamicResource Theme.CardBorder}"
Foreground="{DynamicResource Theme.Foreground}"
FontSize="12"
Height="35" Margin="10,0,10,3"
Cursor="Hand">
<StackPanel Orientation="Horizontal">
<TextBlock Text="+" FontSize="16" Margin="0,0,8,0"
VerticalAlignment="Center"/>
<TextBlock Text="添加分类" VerticalAlignment="Center"/>
</StackPanel>
</Button>
<Button Grid.Row="3"
Command="{Binding ToggleThemeCommand}"
Background="Transparent"
BorderThickness="1"