我现在正在使用 mvvmcross vnext。我在布局中绑定了一个列表项,如下所示:
<TextView
android:id="@+id/item_text"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium"
local:MvxBind="{'Text':{'Path':'Item.Name'}}" />
<TextView
android:id="@+id/item_state_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="right|center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium" />
我想做的是在视图上动态设置绑定item_state_text
。像这样的东西:
if (<some_condition>)
myBinding = "{'Text':{'Path':'Item.LegacyStuff'}}";
TextView stateText = mvxBindableListItemView.FindViewById(Resource.Id.item_state_text) as TextView;
// create binding
this.GetService<IMvxBinder>().Bind(this.ViewModel, stateText , myBinding );
我怎样才能做到这一点
谢谢