Hi All
I am creating a custom control for Xamarin Forms.
One of the properties on my Control is a DataTemplate (rather like the ItemsTemplate property on ListView).
For each platform I will therefore need a 'renderer' or UI factory that converts a DataTemplate into native Controls.
This 'renderer' or UI factory must already exist in order to render existing DataTemplates, but I cannot find out which Xamarin classes are responsible.
Does anyone have any experience of this
Thanks
Dean
Posts
The class to get Renderers is
RendererFactory
. But I'm not sure you need it here. DataTemplate has a methodCreateContent()
that will create a new XF element corresponding to your template. That's higher level than any of the custom renderer code and probably the best way to go about it.As example, here is my item creation code for an ItemsView I made modelled after the MS Xaml ItemsControl. It's fairly basic but gets the job done for what I need.
Ahhhhhh, thanks @JonRuskin - that is exactly what I was after