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

Combine binding parameters

$
0
0

Afternoon Gents,

I see that Xamarin forms does not support binding to x:ElementName. It only supports binding of the x:Reference property. Is this correct? If so, this poses a problem since I need to bind a command that resides in a different ViewModel other then the ViewModel bound to in a list view template.

Here's an example of what I am trying to do:

Button Text="{Binding Title}" Command="{Binding x:ElementName=RootViewModel, Path=CommandToExecute}" CommandParameter="{Binding ParameterToPass}"

The Text and CommandParameter properties are bound to a ListItem in the template. But the Command property is bound to a property in an alternate ViewModel.

I see that x:Reference binds to an alternate XAML element, but that binds to the entire element. I can not use that to bind individual properties. Is there an alternate way to do that? If not, is there something in the works to support x:ElementName binding in an upcoming release of Xamarin? Is there a work around in the meantime?

Thanks
Tim


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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