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

Binding a Command to the ListView instead of item

$
0
0

I have a ListView with its ItemsSource bound to a list in my viewmodel. The list view has custom item template with only a TextCell in it. What I want to do is bind the Command property of the TextCell to a command in my main viewmodel and not in the items (strings). This is normally done in WPF using RelativeSource, is there a similar option in XF?

In the meantime I'm wrapping the items with another viewmodel each containing a reference to the original viewmodel's command but I find this solution suboptimal and usually requiring too much boilerplate.

Thanks in advanced.


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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