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 renderer shim ordering when creating native renderer #1105

Merged
merged 2 commits into from
May 28, 2021

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented May 27, 2021

Description of Change

Currently we are setting the VirtualView on the renderer before setting the Renderer bindable property on the element. When you set the VirtualView this causes OnElementChanged to fire. Any legacy renderer that is watching OnElementChanged might hit a NRE if it tries to access the renderer on the element

This PR also consolidates all the RendererToHandlerShim code into a single file since the files across platforms were all 96 percent the same. Recent changes in project structure made this possible.

I added a Custom Button to our sample app that tests shimming a button. Once we have compatibility device tests then we can create more targeted tests for this behavior.

@PureWeen PureWeen requested a review from jsuarezruiz May 27, 2021 16:43
}

SetRenderer(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main code change from the PR. Just moving this setter up before SetElement is called

@rmarinho rmarinho merged commit 61fa76f into main May 28, 2021
@rmarinho rmarinho deleted the fix_renderer_ordering branch May 28, 2021 08:40
lytico pushed a commit to lytico/maui that referenced this pull request Jun 8, 2021
* Set Renderer before setting virtual view

* - fix NET6 targets
@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2023
@samhouts samhouts added the fixed-in-6.0.100-preview.5 Look for this fix in 6.0.100-preview.5! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants