❔ How do I get event arguments and other data into my view model when using MVVM?
I'm using the Command interface in my XAML code on a
TapGestureRecognizer
->
I'm binding it to a method in my view model which allows me to change page when I select an item from a CollectionView
->
I know i can use a query parameter in the URL to pass that through to the new page but how do I send my currently selected item from the CollectionView
in the View xaml to my View Model so I can populate the following details page with the correct information?
My current assumption is that I bind to SelectedItem
in the collection view in the view xaml but I'm not sure if this is the best approach.
Thanks!2 Replies
My current assumption is that I bind to SelectedItem in the collection view in the view xaml but I'm not sure if this is the best approach.it is, almost certainly if the
Tapped
command is supposed to be "the selected catalog was tapped"
in which case, I'd argue you should name it that way
or really, move TappedCommand
into CatalogueViewModel
the whole setup seems a little weird to me, but I could just be getting the context wrongWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.