Added pre-sorting

- Pre-sorting uses ascending natural sorting
- Previously, the files would initially be displayed in the order the operating system returned
This commit is contained in:
adroslice 2019-12-01 20:10:47 +01:00
parent 10153a9bd2
commit 4119cb9eac

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Text.RegularExpressions;
using Avalonia;
using Avalonia.Input;
using Avalonia.Controls;
using Avalonia.VisualTree;
using Avalonia.Markup.Xaml;
@ -13,7 +14,7 @@ using Avalonia.LogicalTree;
using BFR.Helpers;
using BFR.DataModels;
using Avalonia.Input;
using BFR.Operations;
namespace BFR
{
@ -27,6 +28,7 @@ namespace BFR
{
WorkingDirectory = directory.Replace('\\', '/');
AllFiles.ReplaceAll(Directory.GetFiles(WorkingDirectory).Select(x => new FileModel(x.Replace('\\', '/'))));
new Sort() { Mode = SortMode.Natural }.ApplyTo(AllFiles);
Filter();
}