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);