RadListView events - how to capture events in mvvm

2 posts, 0 answers
  1. bal
    bal avatar
    1 posts
    Member since:
    Mar 2018

    Posted 18 May 2018 Link to this post

    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.

  2. Lance | Manager Technical Support
    Admin
    Lance | Manager Technical Support avatar
    1168 posts

    Posted 21 May 2018 Link to this post

    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
Back to Top