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

DataTemplate with TemplateSelector - bind to parent command

$
0
0

Hi all

I have a ListView with a TemplateSelector and two different DataTemplates (ViewCells). Behind the ListView is a ViewModel for the ConentPage with an ObservableCollection which contains some item-models. The Binding to this Item-Model in my templates work like a charm.

What I want: My ContentPage-ViewModel has some commands. The DataTemplate should use this command. How can I bind to this commands?

I know, that I can make the commands static and reference with x:Static to it. Or I can add the Command to my Item-Model. But both are no Option for my solution.

Thanks in advance


Viewing all articles
Browse latest Browse all 77050

Trending Articles



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