MvvmCross:适用于Android的绑定 [英] MvvmCross: Bindings for Android

查看:30
本文介绍了MvvmCross:适用于Android的绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用mvvmcross开发适用于android和WF8的应用程序.

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

在WF8用户界面中,我使用以下代码:

In WF8 UI I use this code:

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

并访问设置在更高级别的"IsReadOnly"属性,
我可以在android中做同样的事情吗? 我的目标是在Mvx.MvxBindableLinearLayout模板的内部获得属性访问.

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.

预先感谢您的帮助.

推荐答案

当前.不.

除您自己的DataContext外,没有任何绑定访问权限.

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

有一个想法可以访问v3的$parent,但是它没有设定截止时间.

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

目前,最好的方法是通过目标绑定对象提供所需的所有属性-例如,使用Linq提供对List<ObjectWithParent<T>>而不是List<T>

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>

如果您认为此功能很重要,请在github/slodge/mvvmcross上将其记录为功能请求问题,并尽可能提供有关用例的详细信息.

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:适用于Android的绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆