-
Notifications
You must be signed in to change notification settings - Fork 109
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Avalonia provides managed dialogs.

After opening UseManagedSystemDialogs, OpenFileDialog opens abnormally. Add support for managed dialogs.
How to test:
- Add the
UseManagedSystemDialogs()configuration to AppBuilder - Test on dialog windows
Example of calling a window:
private async Task OnImportPicture()
{
if (Application.Current?.ApplicationLifetime is not IClassicDesktopStyleApplicationLifetime desktop ||
desktop.MainWindow?.StorageProvider is not { } provider)
{
throw new NullReferenceException("Missing StorageProvider instance.");
}
IReadOnlyList<IStorageFile> files = await provider.OpenFilePickerAsync(new FilePickerOpenOptions
{
Title = "Choose File",
AllowMultiple = false
}).ConfigureAwait(true);
if (files.Count >= 1)
{
string filePath = files[0].TryGetLocalPath();
if (File.Exists(filePath))
{
Picture = filePath;
}
}
}Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request