using System.ComponentModel;
-using Android.App;
using Android.Content;
using Android.Support.V4.Widget;
using Android.Views;
if (disposing)
{
+ Controller.ScrollToRequested -= OnScrollToRequested;
+
if (_headerRenderer != null)
{
Platform.ClearRenderer(_headerRenderer.View);
_footerView?.Dispose();
_footerView = null;
- // Unhook the adapter from the ListView before disposing of it
if (Control != null)
{
+ // Unhook the adapter from the ListView before disposing of it
Control.Adapter = null;
+
+ Control.SetOnScrollListener(null);
}
if (_adapter != null)
_adapter.Dispose();
_adapter = null;
}
-
- Controller.ScrollToRequested -= OnScrollToRequested;
}
base.Dispose(disposing);
{
((IListViewController)e.OldElement).ScrollToRequested -= OnScrollToRequested;
- if (_adapter != null)
+ if (Control != null)
{
// Unhook the adapter from the ListView before disposing of it
- if (Control != null)
- {
- Control.Adapter = null;
- }
+ Control.Adapter = null;
+
+ Control.SetOnScrollListener(null);
+ }
+ if (_adapter != null)
+ {
_adapter.Dispose();
_adapter = null;
}