@@ -14,12 +14,7 @@ internal class DisplayPageContext : ObservableObject, IDisplayPageContext
14
14
private readonly IPageContext context = Ioc . Default . GetRequiredService < IPageContext > ( ) ;
15
15
private readonly IFoldersSettingsService settings = Ioc . Default . GetRequiredService < IFoldersSettingsService > ( ) ;
16
16
17
- private bool isLayoutAdaptiveEnabled = false ;
18
- public bool IsLayoutAdaptiveEnabled
19
- {
20
- get => isLayoutAdaptiveEnabled ;
21
- set => settings . SyncFolderPreferencesAcrossDirectories = value ;
22
- }
17
+ public bool IsLayoutAdaptiveEnabled => ! settings . SyncFolderPreferencesAcrossDirectories ;
23
18
24
19
private LayoutTypes layoutType = LayoutTypes . None ;
25
20
public LayoutTypes LayoutType
@@ -182,9 +177,8 @@ private void Settings_PropertyChanged(object? sender, PropertyChangedEventArgs e
182
177
{
183
178
if ( e . PropertyName is nameof ( IFoldersSettingsService . SyncFolderPreferencesAcrossDirectories ) )
184
179
{
185
- bool isEnabled = settings . SyncFolderPreferencesAcrossDirectories ;
186
- if ( SetProperty ( ref isLayoutAdaptiveEnabled , isEnabled , nameof ( IsLayoutAdaptiveEnabled ) ) )
187
- SetProperty ( ref layoutType , GetLayoutType ( ) , nameof ( LayoutType ) ) ;
180
+ OnPropertyChanged ( nameof ( IsLayoutAdaptiveEnabled ) ) ;
181
+ SetProperty ( ref layoutType , GetLayoutType ( ) , nameof ( LayoutType ) ) ;
188
182
}
189
183
}
190
184
@@ -216,7 +210,7 @@ private LayoutTypes GetLayoutType()
216
210
if ( viewModel is null )
217
211
return LayoutTypes . None ;
218
212
219
- bool isAdaptive = isLayoutAdaptiveEnabled && viewModel . IsAdaptiveLayoutEnabled && ! viewModel . IsLayoutModeFixed ;
213
+ bool isAdaptive = IsLayoutAdaptiveEnabled && viewModel . IsAdaptiveLayoutEnabled && ! viewModel . IsLayoutModeFixed ;
220
214
if ( isAdaptive )
221
215
return LayoutTypes . Adaptive ;
222
216
0 commit comments