From a8e3954f01a92b853f5593d16b85848c30594577 Mon Sep 17 00:00:00 2001 From: gramps Date: Mon, 5 Oct 2026 13:26:12 -0700 Subject: [PATCH] Fix: add IsAlertBox virtual on SceneElement and override on Source The Stream Alerts properties panel was incorrectly showing for the webcam layer (a WebcamSceneConfig is not a Source) because IsAlertBox only existed on Source, causing WPF binding to be treated as false-but-invisible context or the trigger to bind against the wrong type. Adding a virtual IsAlertBox to the base SceneElement (default false) and overriding on Source prevents the UI block from rendering under webcam selection. Scope: Models/SceneElement.cs, Models/Source.cs, ytLive.Tests/AlertBoxPreviewVisibilityTests.cs. Build/test: app + 4 alert-box tests pass, other failures unrelated (float precision). --- Models/SceneElement.cs | 3 +++ Models/Source.cs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Models/SceneElement.cs b/Models/SceneElement.cs index 50863df..62a0f35 100644 --- a/Models/SceneElement.cs +++ b/Models/SceneElement.cs @@ -77,6 +77,9 @@ public abstract class SceneElement : INotifyPropertyChanged /// True only for Countdown-type sources. Gates timer properties panel. public virtual bool IsCountdown => false; + + /// True only for AlertBox-type sources. Gates stream alerts properties panel. + public virtual bool IsAlertBox => false; public virtual bool IsBackground { get; set; } private bool _useDefaultBackground = true; diff --git a/Models/Source.cs b/Models/Source.cs index 59dfab2..1709a1f 100644 --- a/Models/Source.cs +++ b/Models/Source.cs @@ -238,7 +238,7 @@ public class Source : SceneElement set => Set(ref _alertDisplayMethod, value); } - public bool IsAlertBox => Type == SourceType.AlertBox; + public override bool IsAlertBox => Type == SourceType.AlertBox; // Chat box config (TASK 3.18) private double _chatFontSize = 16;