SfPullToRefresh doesnt execute on page load

I have a SfPullToRefresh control and a ActivityIndicator binding to the same viewmodel property (IsRefreshing and IsRunning bindable properties). ActivityIndicator appear on page load, but not SfPullToRefresh.
In other situations works fine. I need remove ActivityIndicator because it is redundant, so I need fix this SfPullToRefresh behavior.

Can you help me please?

Thanks in advance :)

3 Replies

JA Jayaraman Ayyanar Syncfusion Team July 22, 2018 02:57 PM UTC

Hi Enrique,  
 
We have checked your reported query for “SfPullToRefresh does not execute on page load”. You can achieve your requirement by calling StartRefreshing method inside BeginInvokeOnMainThread method in the OnAppearing() override, please refer the below code example. 
 
Code snippet 
protected async override void OnAppearing()  
{  
    base.OnAppearing();  
    Device.BeginInvokeOnMainThread(() => {  
        pullToRefresh.StartRefreshing();  
    });  
    await Task.Delay(3000);  
    pullToRefresh.EndRefreshing();  
}  
 
Regards,  
Jayaraman. 



EN Enrique July 23, 2018 08:11 AM UTC

So it´s no possible to manage just from VM?

Im have testing your solution. I can startRefreshing() in onAppearing but I need stop it when my load function in VM has finished, but IsRefreshing = false doesnt work as expected. So I understand is a must stop it with EndRefreshing().

My final workaround has been add a reference to pull to refresh control in VM:

-----------------------------------------------------------
InitializeComponent();

var viewModel = ((MyViewModel)this.BindingContext);
viewModel.PullToRefreshControl = pullToRefresh;
-----------------------------------------------------------

But I dont like this solution. I think IsRefreshing true and false should do the same as StartRefreshing() and EndRefreshin() methods.
Is this feature in the road map?

You have very cool controls, but sometimes help is needed like this time.

Thanks!

Regards,
Enrique Ramos


JA Jayaraman Ayyanar Syncfusion Team July 24, 2018 02:17 PM UTC

Hi Enrique,  
  
 
 Disclaimer : The date for the feature implementation is tentative and not a commitment on our parts.  
  
    
Regards,  
Jayaraman.  


Loader.
Up arrow icon