I am using AvaloniaUI and I am trying to implement: http://avaloniaui.net/api/Avalonia.Controls/OpenFolderDialog/
What I want to achieve is when I press a button and it triggers openFold to show up a dialog making me choose a directory. Once I select a directory I want to store it's path in var result.
Here is my code:
public async Task openFold()
{
var dialog = new OpenFolderDialog();
var result = await dialog.ShowAsync();
if (result != null)
{
await openFold(result);
}
Trace.WriteLine("DIR IS: " + result);
}
However I don't know how to pass the current main window to ShowAsync.
I am not sure that even if I pass the current window to ShowAsync it will show up a choose directory dialog. Am I doing it correctly ?