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

Cell ContextAction - calling ViewModel command

$
0
0

I've got a Page with ListView, with an associated ViewModel with Commands.

I've added a ContextAction to my custom ViewCell, to allow the user to delete an item.

Now I want to implement the deletion code as a Command in the ViewModel. The problem is how to call the ViewModel's Delete command from the ContextAction.

I could use messaging or an event my custom ViewCell - but is there a more elegant, built-in way of either accessing the ViewCell's parent page's ViewModel, or informing the Page that the Delete ContextAction has been invoked?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>