refactor: extract HealthBanner + promote converters to theme — Phase 2, Commit 13

HealthBanner.xaml takes the Row 1 YouTube-health banner (report-by-exception).

Converters: promoted the 7 value<->visibility converters (BoolToVis, Inverse,
NotNull, Null, Hidden, EnumToBool, AllTrueToVis) from MainWindow.Window.Resources
into Themes/Controls.xaml so extracted UserControls can resolve them. AGENTS rule:
controls cannot reach into a window's own named resources; they resolve from the
app-level merged theme instead. Promoted all of them (not just NotNullToVis) so
every pending extraction keeps working without window-level references.

Zero behavior change; build 0 warnings; 246 pass, only the 2 known failures.
Docs: ViewModels/index.md Phase 2 tracker updated in the same commit.
This commit is contained in:
2026-08-30 09:11:18 -07:00
parent bc23b64315
commit 691425288f
5 changed files with 39 additions and 25 deletions
+1 -23
View File
@@ -31,21 +31,6 @@
<Window.Resources>
<ResourceDictionary>
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
<Helpers:InverseBoolToVisibilityConverter x:Key="InverseBoolToVis"
xmlns:Helpers="clr-namespace:ytLive.Helpers"/>
<Helpers:NotNullToVisibilityConverter x:Key="NotNullToVis"
xmlns:Helpers="clr-namespace:ytLive.Helpers"/>
<Helpers:NullToVisibilityConverter x:Key="NullToVis"
xmlns:Helpers="clr-namespace:ytLive.Helpers"/>
<Helpers:HiddenBoolToVisibilityConverter x:Key="HiddenBoolToVis"
xmlns:Helpers="clr-namespace:ytLive.Helpers"/>
<Helpers:EnumToBoolConverter x:Key="EnumToBool"
xmlns:Helpers="clr-namespace:ytLive.Helpers"/>
<Helpers:AllTrueToVisibilityConverter x:Key="AllTrueToVis"
xmlns:Helpers="clr-namespace:ytLive.Helpers"/>
<!-- Red dot shown in the taskbar icon while live -->
<DrawingImage x:Key="LiveOverlay">
@@ -207,14 +192,7 @@
</Border>
<!-- ═══ MIDDLE: Main Content ═══ -->
<!-- YouTube health banner (TASK 5 item 3): report-by-exception — visible
ONLY while a warning/error configuration issue exists. Amber for
warning, darker red for error (HealthIssueBackground). -->
<Border Grid.Row="1" Background="{Binding HealthIssueBackground}"
Visibility="{Binding HealthIssueBanner, Converter={StaticResource NotNullToVis}}">
<TextBlock Text="{Binding HealthIssueBanner}" Foreground="White" FontSize="13"
FontWeight="SemiBold" Margin="16,8" TextTrimming="CharacterEllipsis"/>
</Border>
<controls:HealthBanner Grid.Row="1"/>
<Grid Grid.Row="2" Margin="8">
<Grid.RowDefinitions>