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

Fix LayoutUpdated and EffectiveViewportChanged double registration #17196

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

MrJul
Copy link
Member

@MrJul MrJul commented Oct 4, 2024

What does the pull request do?

This PR ensures that Layoutable events LayoutUpdated and EffectiveViewportChanged aren't subscribed twice if they are registered in OnAttachedToVisualTree() or the AttachedToVisualTree event.

Unit tests have been added.

What is the current behavior?

Subscribing to LayoutUpdated or EffectiveViewportChanged while inside OnAttachedToVisualTree effectively adds the handler twice to the underlying LayoutManager.

What is the updated/expected behavior with this PR?

The handler is added only once to LayoutManager.

@MrJul MrJul added bug backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Oct 4, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0052401-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.2.x Consider this PR for backporting to 11.2 branch bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants