protected override void OnElementChanged(VisualElementChangedEventArgs e) { base.OnElementChanged(e); if (refreshControl != null) { return; } if (Element == null) { return; } Element.PropertyChanged += Element_PropertyChanged; refreshControl = new FormsUIRefreshControl(); CustomScrollView customScrollView = (Element as CustomScrollView); if (customScrollView != null) { refreshControl.RefreshCommand = customScrollView.RefreshCommand; Bounces = !customScrollView.DisableBounces; } AlwaysBounceVertical = true; AddSubview(refreshControl); }
protected override void OnElementChanged(VisualElementChangedEventArgs e) { base.OnElementChanged(e); if (_refreshControl != null) return; var pullToRefreshScrollView = (PullToRefreshScrollView)Element; if (pullToRefreshScrollView != null) { pullToRefreshScrollView.PropertyChanged += OnElementPropertyChanged; _refreshControl = new FormsUIRefreshControl { RefreshCommand = pullToRefreshScrollView.RefreshCommand, Message = pullToRefreshScrollView.Message }; AlwaysBounceVertical = true; AddSubview(_refreshControl); } }