File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -94,11 +94,14 @@ public bool IsLayoutModeChanging
94
94
set => SetProperty ( ref isLayoutModeChanging , value ) ;
95
95
}
96
96
97
- public Type GetLayoutType ( string folderPath )
97
+ public Type GetLayoutType ( string folderPath , bool changeLayoutMode = true )
98
98
{
99
99
var prefsForPath = GetLayoutPreferencesForPath ( folderPath ) ;
100
- IsLayoutModeChanging = LayoutPreference . LayoutMode != prefsForPath . LayoutMode ;
101
- LayoutPreference = prefsForPath ;
100
+ if ( changeLayoutMode )
101
+ {
102
+ IsLayoutModeChanging = LayoutPreference . LayoutMode != prefsForPath . LayoutMode ;
103
+ LayoutPreference = prefsForPath ;
104
+ }
102
105
103
106
return ( prefsForPath . LayoutMode ) switch
104
107
{
Original file line number Diff line number Diff line change @@ -503,9 +503,10 @@ public void ResetNavigationStackLayoutMode()
503
503
{
504
504
foreach ( PageStackEntry entry in ItemDisplay . BackStack . ToList ( ) )
505
505
{
506
- if ( entry . Parameter is NavigationArguments args )
506
+ if ( entry . Parameter is NavigationArguments args &&
507
+ args . NavPathParam is not null and not "Home" )
507
508
{
508
- var correctPageType = FolderSettings . GetLayoutType ( args . NavPathParam ) ;
509
+ var correctPageType = FolderSettings . GetLayoutType ( args . NavPathParam , false ) ;
509
510
if ( ! entry . SourcePageType . Equals ( correctPageType ) )
510
511
{
511
512
int index = ItemDisplay . BackStack . IndexOf ( entry ) ;
@@ -518,9 +519,10 @@ public void ResetNavigationStackLayoutMode()
518
519
519
520
foreach ( PageStackEntry entry in ItemDisplay . ForwardStack . ToList ( ) )
520
521
{
521
- if ( entry . Parameter is NavigationArguments args )
522
+ if ( entry . Parameter is NavigationArguments args &&
523
+ args . NavPathParam is not null and not "Home" )
522
524
{
523
- var correctPageType = FolderSettings . GetLayoutType ( args . NavPathParam ) ;
525
+ var correctPageType = FolderSettings . GetLayoutType ( args . NavPathParam , false ) ;
524
526
if ( ! entry . SourcePageType . Equals ( correctPageType ) )
525
527
{
526
528
int index = ItemDisplay . ForwardStack . IndexOf ( entry ) ;
You can’t perform that action at this time.
0 commit comments