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

Calling PCL method from Custom Renderer

$
0
0

Hi,
I have a ScrollView, I've made a custom renderer for it, with added UIRefreshControl for pull-to-refresh feature.

However, I need to somehow notify my PCL class to load new data.

Here is a Refresh method for UIRefreshControl from the Renderer

private void Refresh(object obj, EventArgs args) {
    Debug.WriteLine ("Pull-to-refresh");
    // Need to call a class which is in my PCL for all platforms
    System.Threading.Thread.Sleep (2000);             
    refresh.EndRefreshing ();
}

But I have no idea how to get access to my PCL classes. I've also tried to add a property to my scrollview class however I was not able to make it available in Renderer.

Please, help me.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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