From 27f47401d99e144d33e433a0627b1f6ac601a26b Mon Sep 17 00:00:00 2001 From: Zac Gaetano Date: Wed, 13 May 2026 00:48:03 -0400 Subject: [PATCH] build(winui3): keep SettingsDrawer host deferred + narrow the suspect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tried re-hosting SettingsDrawer with `Visibility="Collapsed"` (no RenderTransform / Storyboard this time). Still crashes the XAML parser at startup with the same HR 0x802b000a. Narrows the suspect: the crash is inside SettingsDrawer.xaml's InitializeComponent, not in MainWindow.xaml's hosting of it. Most likely cause: `IsSelected="True"` on the first NavigationViewItem fires `OnTabSelectionChanged` during the XAML parse, BEFORE the SettingsDrawer code-behind has finished construction — the handler then calls into TabContent which isn't ready, throwing in the parser context. Two fixes to try next session: 1. Drop `IsSelected="True"` from XAML and set it programmatically in the SettingsDrawer constructor AFTER InitializeComponent returns. 2. Verify the OnTabSelectionChanged signature for WinUI 3 1.8 — NavigationView's SelectionChanged is `TypedEventHandler` in 1.8 (might be different from the 1.6 SDK signature I wrote against). For now, the MainWindow's OnSettingsClick is a no-op stub. The drawer XAML is untouched and ready to re-host once one of the above is applied. This commit unblocks the running redesign: dotnet build + run produces the 1280x780 redesigned shell with proper theming, no crash on launch. --- src/TeamsISO.App.WinUI/Views/MainWindow.xaml | 13 ++++++++----- src/TeamsISO.App.WinUI/Views/MainWindow.xaml.cs | 8 ++++---- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/TeamsISO.App.WinUI/Views/MainWindow.xaml b/src/TeamsISO.App.WinUI/Views/MainWindow.xaml index 4f863c9..d41407f 100644 --- a/src/TeamsISO.App.WinUI/Views/MainWindow.xaml +++ b/src/TeamsISO.App.WinUI/Views/MainWindow.xaml @@ -377,11 +377,14 @@ - + - /// Drawer toggle stubbed pending XAML-parse-error triage. The - /// SettingsDrawer XAML itself builds clean and is hosted inline once - /// the launch crash is resolved (see Phase 3 of the migration plan). + /// Settings drawer toggle. Currently a no-op because the drawer host + /// can't be inlined in MainWindow.xaml without crashing the XAML parser; + /// see the comment in MainWindow.xaml at the drawer placeholder. /// private void OnSettingsClick(object sender, RoutedEventArgs e) { - // No-op stub until SettingsDrawerHost re-hosts in MainWindow.xaml. + // No-op until SettingsDrawer.xaml is simplified for WinUI 3 1.8. } ///