MvvmCross: Bindings for Android

2019-01-28 12:17发布

问题:

I'm developing an application for android and WF8 using mvvmcross.

In WF8 UI I use this code:

 IsReadOnly="{Binding Path=DataContext.IsReadOnly, ElementName=DetailPageContentPanel }

and get access to "IsReadOnly" property set at a level above,
Can I do the same in android? My objective is to get a property access inside a template for a Mvx.MvxBindableLinearLayout.

Thank you in advance for help.

回答1:

Currently. No.

There is no binding access to anything except your own DataContext.

There was an idea for access to $parent for v3, but it didn't make the alpha cutoff deadline.

For now, the best way is to provide all the properties you need via the target binding object - eg to use Linq to provide access to a List<ObjectWithParent<T>> instead of List<T>

If you think this functionality is important, please log it as a feature request issue on github/slodge/mvvmcross, providing as much detail about your use case as possible.



标签: mvvmcross