diff --git a/PhotoRenamerGui/MainWindow.axaml b/PhotoRenamerGui/MainWindow.axaml
index 1bd5698..ef31f80 100644
--- a/PhotoRenamerGui/MainWindow.axaml
+++ b/PhotoRenamerGui/MainWindow.axaml
@@ -15,47 +15,47 @@
-
+ VerticalAlignment="Center"
+ VerticalContentAlignment="Center" />
+ VerticalAlignment="Center"
+ VerticalContentAlignment="Center" />
+ Watermark="Input">
+
+
+
+
-
-
+ Watermark="Output">
+
+
+
+
diff --git a/PhotoRenamerGui/MainWindowViewModel.cs b/PhotoRenamerGui/MainWindowViewModel.cs
index 425de1f..868d93e 100644
--- a/PhotoRenamerGui/MainWindowViewModel.cs
+++ b/PhotoRenamerGui/MainWindowViewModel.cs
@@ -1,4 +1,9 @@
+using System.Linq;
+using System.Threading.Tasks;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Platform.Storage;
using CommunityToolkit.Mvvm.ComponentModel;
+using CommunityToolkit.Mvvm.Input;
namespace PhotoRenamerGui;
@@ -6,4 +11,24 @@ public partial class MainWindowViewModel : ObservableObject
{
[ObservableProperty] private string? _inputFolder;
[ObservableProperty] private string? _outputFolder;
+
+ [RelayCommand]
+ private async Task SelectInputFolder()
+ {
+ InputFolder = await SearchFolder();
+ }
+
+ [RelayCommand]
+ private async Task SelectOutputFolder()
+ {
+ OutputFolder = await SearchFolder();
+ }
+
+ private async Task SearchFolder()
+ {
+ var storageProvider = (App.Current.ApplicationLifetime as IClassicDesktopStyleApplicationLifetime).MainWindow
+ .StorageProvider;
+ var result =await storageProvider.OpenFolderPickerAsync(new FolderPickerOpenOptions());
+ return result.FirstOrDefault()?.TryGetLocalPath();
+ }
}
\ No newline at end of file