We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

PullToRefresh and DataGrid using MVVMCross 6.3.0

Thread ID:

Created:

Updated:

Platform:

Replies:

145040 Jun 3,2019 09:41 PM UTC Jun 6,2019 08:35 PM UTC Xamarin.Forms 2
loading
Tags: SfPullToRefresh
bgaprogrammer
Asked On June 3, 2019 09:41 PM UTC

Hello,

I'm trying to adapt the sample of your pulltorefreshbehavior to get a datagrid actually refreshed, but I can't find the way to do it. Because your samples assumes one can simply create a new instance of some kind of anemic viewmodel (for example, check this). That is not a real world scenario.

In my case, the viewmodel I'm binding to the MvxContentPage inherits from MvxViewModel so I can't simply create a new instance, there are dependencies injected, so the idea of "new whatever()" dont work.

I request your help to get a working sample of the behavior using MVVMCross 6.3.0

Pradeep Kumar Balakrishnan [Syncfusion]
Replied On June 4, 2019 06:10 PM UTC

 
Thank you for contacting Syncfusion support. 
 
Currently, we are preparing sample for your requirement “PullToRefresh with SfDatagrid sample in MVVM cross 6.3” in Xamarin forms. We will update the sample in one business days (June 6,2019). We appreciate your patience until then. 
 
Regards, 
Pradeep Kumar B 


Pradeep Kumar Balakrishnan [Syncfusion]
Replied On June 6, 2019 08:35 PM UTC

Hi Jorge, 
 
Thank you for your patience. 
 
We have prepared a sample for your requirement in MVVMCross 6.3 and written behavior for content page and not created new instance for viewmodel instead we have accessed viewmodel from content page binding context. Please refer the following code for reference. 
 
Code snippet: 
protected override void OnBindingContextChanged() 
{ 
    base.OnBindingContextChanged(); 
    BindingContext = AssociatedObject.BindingContext; 
    if(AssociatedObject.BindingContext is PlanetsViewModel) 
    { 
        viewModel = AssociatedObject.BindingContext as PlanetsViewModel; 
    } 
} 
 
We have also attached the sample for your reference in the following link.  
 
In PlantesPage XAML file we have loaded PullToRefresh control and DataGrid as PullableContent 
 
Hope this will help you. 
 
Regards, 
Pradeep Kumar B 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon