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

Storing Controllers Inside Xamarin Forms Custom Renderers

$
0
0

I am creating a Xamarin Forms custom renderer. I need to invoke and manipulate a native iOS view controller inside the custom renderer.

I see two possible options :

  1. Create a custom class and extend UIView and set that as the native control in the custom renderer?
  2. Or should I just set a property directly in the custom renderer? This seems to be what most people do.

After all the examples I have seen it looks like the same renderer can possibly be reused over many different invocations of a forms element so they should not hold state. Especially if you add 10 different declarations of the same element to your page and each element will need its own renderer with its own state. The reason I think this is because of the way OnElementChanged() has to be handled. Am I off base on this?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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