protected override void OnElementChanged(ElementChangedEventArgs <ListView> e) { base.OnElementChanged(e); if (e.NewElement != null) { if (Element.IsPullToRefreshEnabled) { if (container == null) { container = new Win.RefreshContainer(); } container.RefreshRequested += Container_RefreshRequested; var nativeControl = Control; SetNativeControl(container); container.Content = nativeControl; } } else { if (Element.IsPullToRefreshEnabled && container != null) { container.RefreshRequested -= Container_RefreshRequested; container = null; } } }
private void Container_RefreshRequested(Win.RefreshContainer sender, Win.RefreshRequestedEventArgs args) { refreshDeferral = args.GetDeferral(); Element.RefreshCommand?.Execute(null); }