public static LayoutPreferences FromCompositeValue(ApplicationDataCompositeValue compositeValue) { var pref = new LayoutPreferences { LayoutMode = (FolderLayoutModes)(int)compositeValue[nameof(LayoutMode)], GridViewSize = (int)compositeValue[nameof(GridViewSize)], DirectorySortOption = (SortOption)(int)compositeValue[nameof(DirectorySortOption)], DirectorySortDirection = (SortDirection)(int)compositeValue[nameof(DirectorySortDirection)], IsAdaptiveLayoutOverridden = compositeValue[nameof(IsAdaptiveLayoutOverridden)] is bool val ? val : false, }; if (compositeValue.TryGetValue(nameof(DirectoryGroupOption), out var gpOption)) { pref.DirectoryGroupOption = (GroupOption)(int)gpOption; } try { pref.ColumnsViewModel = JsonConvert.DeserializeObject <ColumnsViewModel>(compositeValue[nameof(ColumnsViewModel)] as string, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } catch (Exception) { } return(pref); }
public FolderSettingsViewModel(FolderLayoutModes modeOverride) { rootLayoutMode = modeOverride; this.LayoutPreference = new LayoutPreferences(); SetLayoutInformation(); }
public LayoutPreferences() { this.LayoutMode = App.AppSettings.DefaultLayoutMode; this.GridViewSize = App.AppSettings.DefaultGridViewSize; this.DirectorySortOption = App.AppSettings.DefaultDirectorySortOption; this.DirectorySortDirection = App.AppSettings.DefaultDirectorySortDirection; this.IsAdaptiveLayoutOverridden = false; // Default is always turned on for every dir }
public LayoutPreferences() { this.LayoutMode = UserSettingsService.LayoutSettingsService.DefaultLayoutMode; this.GridViewSize = UserSettingsService.LayoutSettingsService.DefaultGridViewSize; this.DirectorySortOption = UserSettingsService.LayoutSettingsService.DefaultDirectorySortOption; this.DirectoryGroupOption = UserSettingsService.LayoutSettingsService.DefaultDirectoryGroupOption; this.DirectorySortDirection = UserSettingsService.LayoutSettingsService.DefaultDirectorySortDirection; this.SortDirectoriesAlongsideFiles = UserSettingsService.LayoutSettingsService.DefaultSortDirectoriesAlongsideFiles; this.IsAdaptiveLayoutOverridden = false; this.ColumnsViewModel = new ColumnsViewModel(); this.ColumnsViewModel.DateCreatedColumn.UserCollapsed = !UserSettingsService.LayoutSettingsService.ShowDateCreatedColumn; this.ColumnsViewModel.DateModifiedColumn.UserCollapsed = !UserSettingsService.LayoutSettingsService.ShowDateColumn; this.ColumnsViewModel.ItemTypeColumn.UserCollapsed = !UserSettingsService.LayoutSettingsService.ShowTypeColumn; this.ColumnsViewModel.SizeColumn.UserCollapsed = !UserSettingsService.LayoutSettingsService.ShowSizeColumn; this.ColumnsViewModel.TagColumn.UserCollapsed = !UserSettingsService.LayoutSettingsService.ShowFileTagColumn; }
public CurrentInstanceViewModel(FolderLayoutModes rootLayoutMode) { FolderSettings = new FolderSettingsViewModel(rootLayoutMode); }
internal LayoutModeEventArgs(FolderLayoutModes layoutMode, int gridViewSize) { LayoutMode = layoutMode; GridViewSize = gridViewSize; }
public FolderSettingsViewModel(FolderLayoutModes modeOverride) : this() => rootLayoutMode = modeOverride;