Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 691425288f |
@@ -0,0 +1,12 @@
|
|||||||
|
<UserControl x:Class="ytLive.Controls.HealthBanner"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<!-- 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 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>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
namespace ytLive.Controls;
|
||||||
|
|
||||||
|
public partial class HealthBanner : UserControl
|
||||||
|
{
|
||||||
|
public HealthBanner()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-23
@@ -31,21 +31,6 @@
|
|||||||
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<ResourceDictionary>
|
<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 -->
|
<!-- Red dot shown in the taskbar icon while live -->
|
||||||
<DrawingImage x:Key="LiveOverlay">
|
<DrawingImage x:Key="LiveOverlay">
|
||||||
@@ -207,14 +192,7 @@
|
|||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- ═══ MIDDLE: Main Content ═══ -->
|
<!-- ═══ MIDDLE: Main Content ═══ -->
|
||||||
<!-- YouTube health banner (TASK 5 item 3): report-by-exception — visible
|
<controls:HealthBanner Grid.Row="1"/>
|
||||||
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>
|
|
||||||
|
|
||||||
<Grid Grid.Row="2" Margin="8">
|
<Grid Grid.Row="2" Margin="8">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
|
|||||||
+13
-1
@@ -1,5 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:Helpers="clr-namespace:ytLive.Helpers">
|
||||||
|
|
||||||
<!-- Base button style -->
|
<!-- Base button style -->
|
||||||
<Style x:Key="YtButton" TargetType="Button">
|
<Style x:Key="YtButton" TargetType="Button">
|
||||||
@@ -631,4 +632,15 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<!-- Value-to-visibility converters, promoted from MainWindow.Window.Resources
|
||||||
|
so extracted UserControls can resolve them (AGENTS: controls must not
|
||||||
|
reach into a window's own resources; they share the app-level theme). -->
|
||||||
|
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
||||||
|
<Helpers:InverseBoolToVisibilityConverter x:Key="InverseBoolToVis"/>
|
||||||
|
<Helpers:NotNullToVisibilityConverter x:Key="NotNullToVis"/>
|
||||||
|
<Helpers:NullToVisibilityConverter x:Key="NullToVis"/>
|
||||||
|
<Helpers:HiddenBoolToVisibilityConverter x:Key="HiddenBoolToVis"/>
|
||||||
|
<Helpers:EnumToBoolConverter x:Key="EnumToBool"/>
|
||||||
|
<Helpers:AllTrueToVisibilityConverter x:Key="AllTrueToVis"/>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
|
|||||||
+2
-1
@@ -54,7 +54,8 @@ Progress (Commit N/12 · tag):
|
|||||||
- [x] **Phase 1 complete:** core `MainViewModel.cs` split into 10 functional partials (1,890 → 758 lines).
|
- [x] **Phase 1 complete:** core `MainViewModel.cs` split into 10 functional partials (1,890 → 758 lines).
|
||||||
|
|
||||||
**Phase 2 — `MainWindow.xaml` split into UserControls** (new `Controls/` folder, namespace `ytLive.Controls`):
|
**Phase 2 — `MainWindow.xaml` split into UserControls** (new `Controls/` folder, namespace `ytLive.Controls`):
|
||||||
- [x] **Commit 12 · `refactor-commit-12`** — **BottomBar** → `Controls/BottomBar.xaml(.cs)` (gear menu + stream stats + quality dropdown; `GearButton_Click` moved to the control's code-behind). Pending: TopBar, health banner, left scene/chat panel, preview pane, overlay host.
|
- [x] **Commit 12 · `refactor-commit-12`** — **BottomBar** → `Controls/BottomBar.xaml(.cs)` (gear menu + stream stats + quality dropdown; `GearButton_Click` moved to the control's code-behind).
|
||||||
|
- [x] **Commit 13 · `refactor-commit-13`** — **HealthBanner** → `Controls/HealthBanner.xaml` (Row 1). Also promoted the 7 value↔visibility converters out of `MainWindow.Window.Resources` into `Themes/Controls.xaml` so extracted controls can resolve them (app-level, not window-level). Pending: TopBar, left scene/chat panel, preview pane, overlay host.
|
||||||
|
|
||||||
The partial `.cs` files land next to `MainViewModel.cs` in this folder as the split
|
The partial `.cs` files land next to `MainViewModel.cs` in this folder as the split
|
||||||
proceeds; each partial carries its own `using`s and re-declares nothing from core.
|
proceeds; each partial carries its own `using`s and re-declares nothing from core.
|
||||||
Reference in New Issue
Block a user