create library for Custom Renderers

hi,
i need to create custom Renderers for button control (ButtonEx) and the Renderers class should be in library.
Also i need to use the Renderers library in other cross platform projects. utilise reusebility of custom controls?

is it possible???

Best Answers

Answers

  • sumithsudesansumithsudesan USMember ✭✭

    @Hunuman said:
    Yes, Renders are just platform specific classes.

    Most if not all XF plug-ins put their renderers in a dll, so it is most definitely possible.

    Hope this helps,

    Tim

    How do i create such library. ? what type of project?

  • JohnHJohnH GBMember ✭✭✭✭✭

    @sumithsudesan for iOS renderers that would be an iOS class library.

  • sumithsudesansumithsudesan USMember ✭✭
    edited July 2017

    @JohnHair said:
    @sumithsudesan for iOS renderers that would be an iOS class library.

    We create custom Renderer class as follows 'class MyButtonExRenderer : ButtonRenderer'

    But in case of iOS class library or android class library(non cross platform), the ButtonRenderer may not available. what should we do?

  • HunumanHunuman GBMember ✭✭✭✭
    edited July 2017

    @sumithsudesan said
    We create custom Renderer class as follows 'class MyButtonExRenderer : ButtonRenderer'
    But in case of iOS class library or android class library(non cross platform), the ButtonRenderer may not available. what should we do?

    If you consider which namespace ButtonRenderer is declared in - you should be able to answer that for your self.....

    Tim

  • sumithsudesansumithsudesan USMember ✭✭
    edited July 2017

    @Hunuman said:
    Hi @sumithsudesan

    As @JohnHair indicated you will need a class library for each platform being targeted, and likely a portable class library.

    I suggest you review the follow documentation to get you going:
    Custom renderers

    Dependency services.

    Hope this helps,

    Tim

    @Hunuman :

    AndroidRenderersLib -> custom renderer class for android
    IosRenderersLib -> custom renderer class for IOS
    UWPRenderersLib -> custom renderer class for UWP

    how the custom renderer lib invoked ?

  • JohnHJohnH GBMember ✭✭✭✭✭

    @sumithsudesan You really need to read the documentation that @Hununam posted above, all these questions are answered there, covering everything you need including how custom renderers work and are invoked.

  • sumithsudesansumithsudesan USMember ✭✭

    @Hunuman said:

    @sumithsudesan said
    We create custom Renderer class as follows 'class MyButtonExRenderer : ButtonRenderer'
    But in case of iOS class library or android class library(non cross platform), the ButtonRenderer may not available. what should we do?

    If you consider which namespace ButtonRenderer is declared in - you should be able to answer that for your self.....

    Tim

    thank you . its done

  • sumithsudesansumithsudesan USMember ✭✭

    @JohnHair said:
    @sumithsudesan You really need to read the documentation that @Hununam posted above, all these questions are answered there, covering everything you need including how custom renderers work and are invoked.

    thank you

Sign In or Register to comment.