Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to subscribe an event without setting Control.Delegate to null in a Xamarin.iOS custom renderer

$
0
0

I need to extend the Xamarin.Forms ListView to have an async method for scroll the list view to top. Create a control and the custom renderer to subscribe the scrolling ended event inside the OnElementchanged override.

Major code:
protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.ListView> e)
{
...
//Without settings Delegate to null, I am getting "Event registration is overwriting existing delegate..." error

Control.Delegate = null;

//Below line is actually override the Delegate, and cause some problems (for example the Grouping for the list view is not working )
Control.ScrollAnimationEnded += OnScrolledToTop;
...

}

My questions is how should I do in the custom renderer without setting Control.Delegate to null in this Xamarin.iOS custom renderer?

Many thanks.
Kevin Hu


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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