From 54c74d7879dd534fa7240b59d8226379c57c084b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20K=C3=B6nig?= Date: Sun, 31 Dec 2023 12:34:38 +0100 Subject: [PATCH] Fixed returned pathes from OpenFileDialogService and SaveFileDialogService --- .../ViewServices/FileDialogs/OpenFileDialogService.cs | 4 ++-- .../ViewServices/FileDialogs/SaveFileDialogService.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/RolandK.AvaloniaExtensions/ViewServices/FileDialogs/OpenFileDialogService.cs b/src/RolandK.AvaloniaExtensions/ViewServices/FileDialogs/OpenFileDialogService.cs index 7932b92..545defe 100644 --- a/src/RolandK.AvaloniaExtensions/ViewServices/FileDialogs/OpenFileDialogService.cs +++ b/src/RolandK.AvaloniaExtensions/ViewServices/FileDialogs/OpenFileDialogService.cs @@ -43,7 +43,7 @@ public OpenFileDialogService(Window parent) } else { - return selectedFiles[0].Path.ToString(); + return selectedFiles[0].Path.AbsolutePath; } } @@ -73,7 +73,7 @@ public OpenFileDialogService(Window parent) else { return selectedFiles - .Select(x => x.Path.ToString()) + .Select(x => x.Path.AbsolutePath) .ToArray(); } } diff --git a/src/RolandK.AvaloniaExtensions/ViewServices/FileDialogs/SaveFileDialogService.cs b/src/RolandK.AvaloniaExtensions/ViewServices/FileDialogs/SaveFileDialogService.cs index da7288f..37c7827 100644 --- a/src/RolandK.AvaloniaExtensions/ViewServices/FileDialogs/SaveFileDialogService.cs +++ b/src/RolandK.AvaloniaExtensions/ViewServices/FileDialogs/SaveFileDialogService.cs @@ -32,6 +32,6 @@ public SaveFileDialogService(Window parent) var file = await _parent.StorageProvider.SaveFilePickerAsync(filePickerSaveOptions); - return file?.Path.ToString() ?? null; + return file?.Path.AbsolutePath ?? null; } } \ No newline at end of file