Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How do I call a method on a custom Xamarin.Forms control?

$
0
0

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?


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>