As the title says - if I have a custom control, like this one, how can I call a method on the renderer?
My use-case: I'd like to create a custom cross-platform control for rendering SVG's. The logic is somewhat complex, so I'd like it all to reside in the shared-code. The only thing that needs to be platform-specific is the low-level stuff: DrawLine(Point p1, Point p2)
, DrawBezier(Point p1, Point p2, Point p3)
, etc. Thus the shared code needs some way to call DrawLine()
on the platform-specific class (the renderer).
The usual way to do this would be for the shared code to provide an interface that the platform-specific renderer needs to follow, but for some reason Xamarin doesn't do it that way. So how can this be done?