|
1 | 1 | // Copyright (c) 2023 Files Community
|
2 | 2 | // Licensed under the MIT License. See the LICENSE.
|
3 | 3 |
|
4 |
| -using Files.App.UserControls.TabBar; |
5 |
| -using Files.Core.Data.Enums; |
6 | 4 | using Microsoft.UI.Input;
|
7 | 5 | using Microsoft.UI.Xaml;
|
8 | 6 | using Microsoft.UI.Xaml.Controls;
|
@@ -613,8 +611,8 @@ protected void FilesystemViewModel_ItemLoadStatusChanged(object sender, ItemLoad
|
613 | 611 | var columnCanNavigateForward = false;
|
614 | 612 | if (SlimContentPage is ColumnViewBrowser browser)
|
615 | 613 | {
|
616 |
| - columnCanNavigateBackward = browser.ParentShellPageInstance.CanNavigateBackward; |
617 |
| - columnCanNavigateForward = browser.ParentShellPageInstance.CanNavigateForward; |
| 614 | + columnCanNavigateBackward = browser.ParentShellPageInstance?.CanNavigateBackward ?? false; |
| 615 | + columnCanNavigateForward = browser.ParentShellPageInstance?.CanNavigateForward ?? false; |
618 | 616 | }
|
619 | 617 | ToolbarViewModel.CanGoBack = ItemDisplay.CanGoBack || columnCanNavigateBackward;
|
620 | 618 | ToolbarViewModel.CanGoForward = ItemDisplay.CanGoForward || columnCanNavigateForward;
|
@@ -731,7 +729,8 @@ protected static ContentDialog SetContentDialogRoot(ContentDialog contentDialog)
|
731 | 729 | private void HandleBackForwardRequest(PageStackEntry pageContent)
|
732 | 730 | {
|
733 | 731 | var incomingPageNavPath = pageContent.Parameter as NavigationArguments;
|
734 |
| - incomingPageNavPath.IsLayoutSwitch = false; |
| 732 | + if (incomingPageNavPath is not null) |
| 733 | + incomingPageNavPath.IsLayoutSwitch = false; |
735 | 734 |
|
736 | 735 | // Update layout type
|
737 | 736 | if (pageContent.SourcePageType != typeof(HomePage))
|
|
0 commit comments