Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/Files.App/Views/Layouts/DetailsLayoutPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ public DetailsLayoutPage() : base()
DataContext = this;
var selectionRectangle = RectangleSelection.Create(FileList, SelectionRectangle, FileList_SelectionChanged);
selectionRectangle.SelectionEnded += SelectionRectangle_SelectionEnded;

UpdateSortOptionsCommand = new RelayCommand<string>(x =>
{
if (!Enum.TryParse<SortOption>(x, out var val))
return;
if (FolderSettings.DirectorySortOption == val)
{
FolderSettings.DirectorySortDirection = (SortDirection)(((int)FolderSettings.DirectorySortDirection + 1) % 2);
}
else
{
FolderSettings.DirectorySortOption = val;
FolderSettings.DirectorySortDirection = SortDirection.Ascending;
}
});
}

// Methods
Expand Down Expand Up @@ -150,21 +165,6 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
if (parameters.IsLayoutSwitch)
_ = ReloadItemIconsAsync();

UpdateSortOptionsCommand = new RelayCommand<string>(x =>
{
if (!Enum.TryParse<SortOption>(x, out var val))
return;
if (FolderSettings.DirectorySortOption == val)
{
FolderSettings.DirectorySortDirection = (SortDirection)(((int)FolderSettings.DirectorySortDirection + 1) % 2);
}
else
{
FolderSettings.DirectorySortOption = val;
FolderSettings.DirectorySortDirection = SortDirection.Ascending;
}
});

FilesystemViewModel_PageTypeUpdated(null, new PageTypeUpdatedEventArgs()
{
IsTypeCloudDrive = InstanceViewModel?.IsPageTypeCloudDrive ?? false,
Expand Down