This is a migrated thread and some comments may be shown as answers.
RadListView events - how to capture events in mvvm
1 Answer 12 Views
This is a migrated thread and some comments may be shown as answers.
bal
Top achievements
Rank 1
bal asked on 18 May 2018, 11:56 AM

hi,

how can you capture the firing of the radlistview events e.g. ReorderEnded within a mvvm framework?

a code example showing this would be useful, without any code-behind bing used.

so, how is the event specified in the view (xaml) and how is it wired up in the viewmodel?

thanks.

1 Answer, 1 is accepted

Sort by
0
Lance | Manager Technical Support
Telerik team
answered on 21 May 2018, 07:09 PM
Hi Bal,

We do not have any documentation for such an approach because it's a general MVVM programming concept and not directly related to a UI for Xamarin control or API. Generally speaking you do no want to directly hook an event into a view model as this breaks the MVVM pattern.

However, there is an approach that you can use that will keep the view decoupled from the view model but still listen for events. You can find many help articles by searching for "Xamarin Forms How to wire up event to view model in MVVM". A really good post on this topic is from Xamarin themselves, take a look at Turn Events into Commands (this uses EventToCommandBehavior).

Alternatively, you can use the RadListView commands instead of events, you can find more information in the RadListView Commands documentation.

Regards,
Lance | Tech Support Engineer, Sr.
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Asked by
bal
Top achievements
Rank 1
Answers by
Lance | Manager Technical Support
Telerik team
Share this question
or