From a71bbb56eaa2c363288b321aa859f1e9b926aa9e Mon Sep 17 00:00:00 2001 From: Mike James Date: Mon, 13 Jul 2026 16:23:43 +0200 Subject: [PATCH] Fluent2: paint window canvas via tree-anchored resource in template MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the theme is materialized as a deferred keyed resource (as ControlCatalog declares it in App.xaml) the Window ControlTheme's Background styled setter never resolves its DynamicResource, leaving the white transparency fallback visible under semi-transparent page layers — dark mode composited to light gray. Inner controls were unaffected because template-level DynamicResource resolves through the visual tree. Add a canvas border in the window template that paints SolidBackgroundFillColorBaseBrush via the tree-anchored path; a user-set Background still paints over it via the existing TemplateBinding border. The styled-setter anomaly itself is an Avalonia core issue to investigate. Co-Authored-By: Claude Fable 5 --- src/Avalonia.Themes.Fluent2/Controls/Window.xaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Avalonia.Themes.Fluent2/Controls/Window.xaml b/src/Avalonia.Themes.Fluent2/Controls/Window.xaml index 0113c02e38..72bad357da 100644 --- a/src/Avalonia.Themes.Fluent2/Controls/Window.xaml +++ b/src/Avalonia.Themes.Fluent2/Controls/Window.xaml @@ -15,6 +15,13 @@ + +