Search code examples
xamarinxamarin.formsportable-class-librarycustom-renderer

Using a custom renderer in PCL library


I want to use my custom renderer inside a PCL. Is it possible? Or can I initialize my custom renderer inside this PCL?


Solution

  • Finally, I've found a solution. I've just created a class in my PCL and used it in XAML, let's say:

    public class MyHelperEntry : Entry { public MyHelperEntry() { } }
    

    that inherits Entry class. And in an App, where I use this PCL, I've created a class, that inherits MyHelperEntry:

    public CustomHelperEntry : MyHelperEntry { public CustomHelperEntry() { } }
    

    and used this CustomHelperEntry as a custom renderer.