Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIlePicker on MacOS #1055

Closed
ozster123 opened this issue Nov 3, 2022 · 1 comment
Closed

FIlePicker on MacOS #1055

ozster123 opened this issue Nov 3, 2022 · 1 comment
Labels
Pri3 product-question Product usage related questions [org]

Comments

@ozster123
Copy link

While using FilePicker on MacOS it will regularly return null for the FileResult when a file is chosen. Code below. After a few selects it works. No exceptions or crashes.
Any ideas?

Version 17.4 Preview (17.4 build 2366)
Runtime
.NET 6.0.9 (64-bit)
Architecture: X64

private async Task<FileResult> ChooseModelFile()
{
	try
	{
                FilePickerFileType filePickerFileType = new FilePickerFileType(
                    new Dictionary<DevicePlatform, IEnumerable<string>>{
                    { DevicePlatform.MacCatalyst, new [] { "json" } },
                    { DevicePlatform.macOS, new [] { "json"} },
                    { DevicePlatform.WinUI, new [] { ".json" } }
                    });
                PickOptions pickOptions = new PickOptions
                {
                    PickerTitle = "Choose an engine file.",
                    FileTypes = filePickerFileType
                };

                return await FilePicker.Default.PickAsync(pickOptions);
        }
        catch (Exception e)
	{
		Console.WriteLine(String.Format("Exception {0}", e.Message));
	}
	return null;
}
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Nov 3, 2022
@davidbritch davidbritch added the product-question Product usage related questions [org] label Dec 22, 2022
@davidbritch
Copy link
Contributor

Hi @ozster123

Afraid that this is an issue for the engineers. It looks like you've already opened an issue in the engineering repo (dotnet/maui#11088) so I'll close it here.

@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pri3 product-question Product usage related questions [org]
Projects
None yet
Development

No branches or pull requests

3 participants