-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Renderer to Handler and Handler to Renderer Shims #12546
Conversation
4c52518
to
62335ca
Compare
@@ -173,88 +173,5 @@ void ValidateGesture(IGestureRecognizer gesture) | |||
if (gesture is PinchGestureRecognizer && _gestureRecognizers.GetGesturesFor<PinchGestureRecognizer>().Count() > 1) | |||
throw new InvalidOperationException($"Only one {nameof(PinchGestureRecognizer)} per view is allowed"); | |||
} | |||
|
|||
#region IView |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hartez is it alright that I moved these to VisualElement?
/azp run |
No pipelines are associated with this pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PureWeen Could we add some tests to validate the use of RendererToHandlerShim
and RendererToHandlerShim
?
@PureWeen can we rebase and add some tests to make sure this works fine? |
90f6f34
to
3b27a2a
Compare
9ecc24f
to
a166bfd
Compare
So in theory our Control Gallery tests are the UI Tests for the shims. Also, we can't really do any tests for RendererToHandlerShim until we have the Handler.Testing project setup or the Appium project At that point we can write some tests to verify that the renderers shim correctly into handlers. |
Description of Change
HandlerToRendererShim
for cases where people are still in the Context of a Forms app and will call Platform.CreateRendererRendererToHandlerShim
for cases where the user has registered a renderer that only implements IVisualElementRendererAPI Changes
This is an xplat way to register the handlers as we add handlers you can register the new handler here and it'll be used for CG.
https://github.com/xamarin/Xamarin.Forms/pull/12546/files#diff-5a7d3f99f1c9eb4b20a63099a3a317f3a39ba74e719355aa92a8803836209fe0R7
Platforms Affected
Examples
Legacy Apps
Given the following code
Button can be registered to either a Handler or a Renderer and the registrar will react accordingly. The ContentPage calls CreateRenderer on its content which will return an IVisualElementRenderer. If the Content is of type IViewHandler then it gets wrapped with a HandlerToRendererShim so that ContentPage can still render the control successfully
Future Apps
If you just register a Shim against the handler then the Shim will reach out to the old registrar for the type
PR Checklist