mirror of
https://github.com/muskit/MercuryConverter.git
synced 2026-06-02 20:24:26 -07:00
refactors and more UI
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Platform.Storage;
|
||||
using Avalonia.Threading;
|
||||
|
||||
namespace MercuryConverter.UI.Dialogs;
|
||||
|
||||
public partial class DataOpen : Window
|
||||
{
|
||||
public DataOpen()
|
||||
{
|
||||
InitializeComponent();
|
||||
BeginDirSelection();
|
||||
}
|
||||
|
||||
private void BeginDirSelection()
|
||||
{
|
||||
Dispatcher.UIThread.Invoke(async () =>
|
||||
{
|
||||
await Task.Delay(200);
|
||||
var dirSelection = await GetTopLevel(this)!.StorageProvider.OpenFolderPickerAsync
|
||||
(
|
||||
new FolderPickerOpenOptions
|
||||
{
|
||||
Title = "Open Data Folder",
|
||||
AllowMultiple = false,
|
||||
}
|
||||
);
|
||||
|
||||
if (dirSelection.Count <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var d = dirSelection!.First().TryGetLocalPath()!;
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user