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

ExportRenderer contracts in PCL

$
0
0

If I create a control that is rendered differently between platforms using ExportRenderer, can I add a method that can then be overridden by the class marked for ExportRenderer?

Example:

Class inside of PCL:

public class CustomListView : ListView {
    public void MethodToOverride() {
        //this method is what I want to override
    }
}

Class inside of iOS:

[assembly: ExportRenderer(typeof(CustomListView), typeof(CustomListViewRenderer))]

public class CustomListViewRenderer : ListViewRenderer {
    public void MethodToOverride() {
        //do iOS-specific stuff here
    }
}

What I'm trying to do is implement the platform-specific scroll functionality, since Xamarin.Forms doesn't have an API to use to automatically scroll (that I know of.)

Thanks,
Spencer


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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