Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

ElectronNET Electron.Dialog.ShowOpenDialogAsync never returns

$
0
0

Consider the following code:

private async Task ShowOpenFileDialogAsync(){    BrowserWindow? mainWindow = Electron.WindowManager.BrowserWindows.First();    OpenDialogOptions options = new()    {        Title = "Choose a file",        Properties = [OpenDialogProperty.openFile],        Filters = [new FileFilter { Name = "JSON Files", Extensions = ["json"] }]    };    await Electron.Dialog.ShowOpenDialogAsync(mainWindow, options);    Console.WriteLine("done");}

This is called from Blazor like so:

<button @onclick="ShowOpenFileDialogAsync">Open</button>

This displays the open file dialog, but "done" is never printed to the console, indicating that Electron.Dialog.ShowOpenDialogAsync never returns anything.

Have I missed something somewhere? I can't seem to find any documentation about how to interact with dialogs to know whether this code is correct or not.

Note:

  • OS = macOS Sequoia
  • ElectronNET = version 23.6.2
  • App = Blazor Server .NET 8.0

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>