J'ai un objet personnalisé dans mon ViewModel. Je veux lier un seul de ses membres à la vue texte dans ma vue droid. Trouvé ce lien: Bind data of custom object to TextView in MvvmCross Et je fais exactement comme ça. locale: MvxBind = « Texte Myobject.ItsMember »La liaison de données MVVMCross ne fonctionne pas
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:text="LabelCaption" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:textColor="@android:color/white"
local:MvxBind="Text Myobject.ItsMember" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
Contrôlé le boîtier, etc., mais la liaison ne fonctionne pas et je ne peux pas voir la valeur de chaîne apparaissant à l'écran pendant que je peux l'imprimer dans la fenêtre de débogage. Des indices où je peux me tromper?
Où gonflez-vous cette vue? – Cheesebaron
[Activité (label = "MyView")] public class MyView: MvxActivity { protected override vide OnViewModelSet() \t \t { setContentView (Resource.Layout.MyView); \t \t} } – Vivek
Et 'Myobject' est le nom de la propriété dans votre ViewModel? – Cheesebaron