This question is locked. New answers and comments are not allowed.
Hello,
is it possible to bind the Pull To Refresh Beahviour to a command in the ViewModel ? If so how should I proceed, do you have any examples or samples that show how to do it ?
Thank You !
is it possible to bind the Pull To Refresh Beahviour to a command in the ViewModel ? If so how should I proceed, do you have any examples or samples that show how to do it ?
Thank You !
6 Answers, 1 is accepted
0
Accepted
Hello Amine,
I have prepared sample demonstrating one way to implement MVVM with RadDataBoundListBox. Have a look at the project attached and let us know if this helps.
Regards,
Tsvyatko
Telerik
I have prepared sample demonstrating one way to implement MVVM with RadDataBoundListBox. Have a look at the project attached and let us know if this helps.
Regards,
Tsvyatko
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Lel12
Top achievements
Rank 1
answered on 12 Jul 2014, 02:22 PM
Thank you for your sample which works really well ! But How can I call StopPullToRefreshLoading(true) in my ViewModel?
0
Hi Amine,
I am not completely sure what is your scenario. Could you please elaborate a bit more on when you wish to call the StopPullToRefreshLoading method?
I look forward to your reply.
Regards,
Rosy Topchiyska
Telerik
I am not completely sure what is your scenario. Could you please elaborate a bit more on when you wish to call the StopPullToRefreshLoading method?
I look forward to your reply.
Regards,
Rosy Topchiyska
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Lel12
Top achievements
Rank 1
answered on 16 Jul 2014, 11:29 PM
Hello,
For Example I Have this Delegate that I initialize in my construor :
refreshCommand = new DelegateCommand((s) =>
{
Update();
});
Where Update() is a REST request with Hammock :
public void Update()
{
[.....]
restClient.BeginRequest(restRequest, UpdatecallBack);
}
After my CallBack function finishes, the little animation that shows that the ListBox is Loading is still Spinning even after my function finished loading the data. How can I make the indicator stop spinning ?
Thank you !
For Example I Have this Delegate that I initialize in my construor :
refreshCommand = new DelegateCommand((s) =>
{
Update();
});
Where Update() is a REST request with Hammock :
public void Update()
{
[.....]
restClient.BeginRequest(restRequest, UpdatecallBack);
}
After my CallBack function finishes, the little animation that shows that the ListBox is Loading is still Spinning even after my function finished loading the data. How can I make the indicator stop spinning ?
Thank you !
0
Accepted
Hello Amine,
Here is a modification in the context of the sample project we have sent you. You can try to keep the action parameter of the command in a field of the view model class and in the UpdateCallback(..) method you can try to execute the action:
Let us know if this works for you.
Regards,
Rosy Topchiyska
Telerik
Here is a modification in the context of the sample project we have sent you. You can try to keep the action parameter of the command in a field of the view model class and in the UpdateCallback(..) method you can try to execute the action:
public
class
MainViewModel
{
private
Action callbackAction;
public
MainViewModel()
{
...
this
.Command =
new
DelegateCommand(async (s) =>
{
this
.callbackAction = (Action)s;
this
.Update();
});
}
private
void
UpdateCallback(RestRequest request, RestResponse response,
object
userState)
{
//update the Data collection
if
(
this
.callbackAction !=
null
)
{
this
.callbackAction();
}
}
...
}
Let us know if this works for you.
Regards,
Rosy Topchiyska
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Lel12
Top achievements
Rank 1
answered on 23 Jul 2014, 01:47 AM
Thank you it works like a charm !