Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

Bind a Command from list view itemTemplate (MenuItem)

$
0
0

Hi all,

I have a list view, and I am using Xamarin Forms Content Actions functionality to add some swipe functionality.

        var moreAction = new MenuItem { Text = "Add Result", };
        ContextActions.Add (moreAction);

This is the code added on the itemTemplate of the listview.

The thing is I don't need to delete, I need to somehow bind this button to a ViewModel class (the same viewModel as the page displaying the list view), so I can navigate to a new page and allow the user to add some information to the record (it will be a REST request).

Anyone has any ideas on how i could achieve this? I'd greatly appreciate it!

Thanks!


Viewing all articles
Browse latest Browse all 75885

Trending Articles