From 4119cb9eac75d04a7ce5e69ff46c73d07143f729 Mon Sep 17 00:00:00 2001 From: adroslice Date: Sun, 1 Dec 2019 20:10:47 +0100 Subject: [PATCH] Added pre-sorting - Pre-sorting uses ascending natural sorting - Previously, the files would initially be displayed in the order the operating system returned --- BFR/MainWindow.xaml.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BFR/MainWindow.xaml.cs b/BFR/MainWindow.xaml.cs index da35540..f39f59c 100644 --- a/BFR/MainWindow.xaml.cs +++ b/BFR/MainWindow.xaml.cs @@ -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(); }