Skip to content

macOS: Fix file dialogs in embedded views#20719

Open
MrJul wants to merge 1 commit intoAvaloniaUI:masterfrom
MrJul:fix/macos-filedialog-embedded
Open

macOS: Fix file dialogs in embedded views#20719
MrJul wants to merge 1 commit intoAvaloniaUI:masterfrom
MrJul:fix/macos-filedialog-embedded

Conversation

@MrJul
Copy link
Member

@MrJul MrJul commented Feb 19, 2026

What does the pull request do?

This PR fixes StorageProvider.OpenFileDialog/SaveFileDialog/SelectFolderDialog not working when the Avalonia view is embedded inside a native NSWindow.

What is the current behavior?

An exception is thrown when trying to open a file dialog from an EmbeddableControlRoot embedded inside a NSWindow:

System.InvalidCastException: Unable to cast object of type 'Avalonia.Native.Interop.Impl.__MicroComIAvnTopLevelProxy' to type 'Avalonia.Native.Interop.IAvnWindow'.

What is the updated/expected behavior with this PR?

No exception is thrown, the dialog opens correctly.

@MrJul MrJul added bug os-macos customer-priority Issue reported by a customer with a support agreement. backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Feb 19, 2026
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 12.0.999-cibuild0062367-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch bug customer-priority Issue reported by a customer with a support agreement. os-macos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments