public interface INativeDialogsThe OS's own file pickers and message boxes.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Native, not drawn by Vixen.Ui, and that is worth being firm about: a file picker is where the user's places, tags, network shares, cloud providers, search and accessibility settings live. A drawn one has none of those, and every application that has shipped one has been told so. It is also the only way to obtain a file at all inside a Flatpak or macOS sandbox, where the picker's result is what grants the read permission.
Asynchronous because these are modal: the platform runs its own event loop while one is open, and a synchronous call would either block the frame loop or reenter it. Awaiting keeps the loop running and keeps the reentrancy inside the implementation, where it can be dealt with once.
Every method returns nothing-chosen rather than throwing when the user cancels, and the same when NativeDialogs is absent — a headless build asked to open a picker has no user to ask, and that is a case the caller already has to handle for cancellation.
Methods (5)
ValueTask<string?> OpenFileAsync(FileDialogOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))Asks the user to pick one existing file.
ValueTask<IReadOnlyList<string>> OpenFilesAsync(FileDialogOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))Asks the user to pick one or more existing files.
ValueTask<string?> SaveFileAsync(FileDialogOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))Asks the user where to save.
ValueTask<string?> OpenFolderAsync(FileDialogOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))Asks the user to pick a folder.
ValueTask<MessageBoxResult> ShowMessageAsync(MessageBoxOptions options, IWindow? owner = null, CancellationToken cancellationToken = default(CancellationToken))Shows a message box and waits for an answer.
Used by (15)
- DesktopDialogsVixen.Platform.Desktop
- DesktopPlatformVixen.Platform.Desktop
- HeadlessDialogsVixen.Platform.Headless
- HeadlessLifecycleTestsVixen.Platform.Headless.Tests
- HeadlessPlatformVixen.Platform.Headless
- IPlatformVixen.Platform
- LinuxDialogsVixen.Platform.Linux
- MacOSDialogsVixen.Platform.MacOS
- NothingDialogsVixen.Platform.MacOS.Tests
- NothingDialogsVixen.Platform.Desktop.Tests
- PlatformServicesVixen.Platform
- RecordingSupplementVixen.Platform.Desktop.Tests
- WindowsDialogsVixen.Platform.Windows
- EditorApplicationVixen.Editor.App
- EditorServicesVixen.Editor.App