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

Ignore handler mappings that are already processed by VisualElementRenderer #1215

Merged
merged 4 commits into from
Jun 9, 2021

Conversation

PureWeen
Copy link
Member

@PureWeen PureWeen commented Jun 8, 2021

Description of Change

If we're shimming a renderer to a handler then we don't want properties that are already being handled by VisualElementRenderer (Scale/ScaleX/Background/etc....) to also be handled by the ViewHandler. This has the potential to cause competing implementations.

@@ -35,6 +35,10 @@ internal class Platform : BindableObject, IPlatformLayout, INavigation, IDisposa
var view = bindable as VisualElement;
if (view != null)
view.IsPlatformEnabled = newvalue != null;

if (view.Handler == null && newvalue is IVisualElementRenderer ver)
view.Handler = new RendererToHandlerShim(ver);
Copy link
Member Author

Choose a reason for hiding this comment

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

We want all views to have a Handler for consistency. This way if there's a shimmed control you can still access the native elements via the Handler. This will also make it easier to implement gestures because all of the native gesture code can just be changed to retrieve the native controls via the Handler

@rmarinho rmarinho merged commit d2df310 into main Jun 9, 2021
@rmarinho rmarinho deleted the ignore_handler_methods_for_shims branch June 9, 2021 08:33
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 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.

5 participants