From 007a5f0b11260b5193e5df609d9420a8e2a203be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20B=C3=A1lint=20Hunor?= Date: Mon, 5 Oct 2026 21:52:44 +0300 Subject: [PATCH] Fix toolbar row missing on Linux: realize x:Load controls on Loaded Upstream sync (#63) moved FindName for the toolbar, tab bar and nav toolbar into the MainPage constructor. On Uno the x:Bind bindings of those controls are not initialized that early, so the toolbar row never showed. Keep the constructor path on Windows and use Page_Loaded elsewhere. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01LeKXJc3DnK3PzAqwgA72NY --- src/Files.App/Views/MainPage.xaml.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Files.App/Views/MainPage.xaml.cs b/src/Files.App/Views/MainPage.xaml.cs index a00fdcbb1c75..8c6c791dea9e 100644 --- a/src/Files.App/Views/MainPage.xaml.cs +++ b/src/Files.App/Views/MainPage.xaml.cs @@ -93,10 +93,12 @@ public MainPage() ApplySidebarWidthState(); +#if WINDOWS // Realize the navigation controls before the first measure pass. FindName(nameof(InnerNavigationToolbar)); FindName(nameof(TabControl)); FindName(nameof(NavToolbar)); +#endif } private void NumberedTabKeyboardAccelerator_Invoked(KeyboardAccelerator sender, KeyboardAcceleratorInvokedEventArgs e) @@ -359,6 +361,12 @@ protected override void OnLostFocus(RoutedEventArgs e) private void Page_Loaded(object sender, RoutedEventArgs e) { ViewModel.OnPageLoaded(); +#if !WINDOWS + // LINUX-TODO(toolbar): realizing x:Load controls in the constructor leaves their x:Bind bindings uninitialized on Uno (toolbar row never shows), so defer to Loaded. + FindName(nameof(InnerNavigationToolbar)); + FindName(nameof(TabControl)); + FindName(nameof(NavToolbar)); +#endif MainWindow.Instance.AppWindow.Changed += (_, _) => MainWindow.Instance.RaiseSetTitleBarDragRegion(SetTitleBarDragRegion);