diff --git a/BFR/MainWindow.xaml.cs b/BFR/MainWindow.xaml.cs index 94a03c9..da35540 100644 --- a/BFR/MainWindow.xaml.cs +++ b/BFR/MainWindow.xaml.cs @@ -7,14 +7,13 @@ using System.Text.RegularExpressions; using Avalonia; using Avalonia.Controls; +using Avalonia.VisualTree; using Avalonia.Markup.Xaml; +using Avalonia.LogicalTree; using BFR.Helpers; using BFR.DataModels; -using Avalonia.Interactivity; using Avalonia.Input; -using Avalonia.LogicalTree; -using Avalonia.VisualTree; namespace BFR { @@ -26,8 +25,8 @@ namespace BFR public async Task OpenDirectoryButtonClick() => OpenDirectory(await new OpenFolderDialog() { Directory = WorkingDirectory }.ShowAsync(this)); public void OpenDirectory(string directory) { - WorkingDirectory = directory; - AllFiles.ReplaceAll(Directory.GetFiles(WorkingDirectory).Select(x => new FileModel(x))); + WorkingDirectory = directory.Replace('\\', '/'); + AllFiles.ReplaceAll(Directory.GetFiles(WorkingDirectory).Select(x => new FileModel(x.Replace('\\', '/')))); Filter(); } @@ -137,7 +136,7 @@ namespace BFR { AvaloniaXamlLoader.Load(this); DataContext = this; - OpenDirectory(Environment.OSVersion.Platform == PlatformID.Win32NT ? @"C:\Users" : @"\home"); + OpenDirectory(Environment.OSVersion.Platform == PlatformID.Win32NT ? @"C:/Users/" : @"/home/"); HandleEvents = true; OperationsListBox = this.Find("OperationsListBox"); } diff --git a/BFR/Models/FileModel.cs b/BFR/Models/FileModel.cs index dc0e5b9..ddfcb5b 100644 --- a/BFR/Models/FileModel.cs +++ b/BFR/Models/FileModel.cs @@ -27,8 +27,8 @@ get => $"{Directory}{FullName}"; set { - FullName = value.Substring(value.LastIndexOf('\\') + 1); - Directory = value.Substring(0, value.LastIndexOf('\\') + 1); + FullName = value.Substring(value.LastIndexOf('/') + 1); + Directory = value.Substring(0, value.LastIndexOf('/') + 1); } }