Assembly declaration in Xamarin custom renders

I was reading the Xamarin Forms Documentation for Custom Renders trying to understand what the assembly attribute is, required for every rendering implementation. I went through the C # documentation for collectors and couldn't find a (simple) explanation. Going with the MyEntry example described in the documentation, can someone shed some light on what is going on with this assembly attribute / what it actually does?

For clarity, this is the type of statements I'm talking about: [assembly: ExportRenderer (typeof (MyEntry), typeof (MyEntryRenderer))]

+3


source to share


1 answer


[assembly: ExportRenderer (typeof (MyEntry), typeof (MyEntryRenderer))]

      

MyEntry

is the name of the placeholder class in your Shared Form Library (PCL or Shared).



MyEntryRenderer

is the name of the actual platform-specific implementation class in the iOS / Android / WP project.

Essentially, you are telling Forms "when you need to render MyEntry

on the X platform, use a class MyEntryRenderer

."

+4


source







All Articles