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

Convert IAvaloniaXamlIlParentStackProvider to eager one if needed #16028

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented Jun 14, 2024

What does the pull request do?

This PR correctly handles IAvaloniaXamlIlParentStackProvider parents that don't implement the new IAvaloniaXamlIlEagerParentStackProvider, in the generated XAML Context.

This happens when a XAML file compiled with Avalonia 11.0 implicitly loads a XAML file that is now compiled with Avalonia 11.1 (for example, loading FluentTheme).

What is the current behavior?

An InvalidCastException occurs.

What is the updated/expected behavior with this PR?

No exception, everything works.

How was the solution implemented (if it's not obvious)?

An intermediate XamlIlParentStackProviderWrapper is instantiated if needed.

Fixed issues

@avaloniaui-bot
Copy link

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

@kerams
Copy link

kerams commented Jun 14, 2024

Unfortunate that the RC has been released without this. My bad, the PR came in later.

@MrJul MrJul added the backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch label Jun 14, 2024
@kekekeks kekekeks added this pull request to the merge queue Jun 18, 2024
Merged via the queue into AvaloniaUI:master with commit 4aec7ac Jun 18, 2024
11 checks passed
@grokys grokys added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Jun 28, 2024
@MrJul MrJul deleted the fix/eager-parent-stack-compat branch July 4, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EagerParentStackEnumerator is incompatible with XAML built with older avalonia versions
6 participants