简体   繁体   中英

FileOpenPicker not working in C# on Windows 11 Desktop

I am creating a Windows Form App in VS on Windows11 and get this error when I attempt to run my file picker function: System.NotImplementedException: 'The member IAsyncOperation<IReadOnlyList> FileOpenPicker.PickMultipleFilesAsync() is not implemented in Uno.'

The Code:

        var picker = new FileOpenPicker();
        picker.ViewMode = PickerViewMode.Thumbnail;
        picker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
        picker.FileTypeFilter.Add(".png");

        var files = await picker.PickMultipleFilesAsync();     
        if(files!=null){//stuff n things}

Windows 11 has its own method for opening files. FilePicker will not work in the new App environtment.

How To Open Files

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM