MvxListView erstellt aus Code eine Bindung für das Vorlagenlayout

Nehmen wir an, ich habe ein einfaches Layout mit einer MvxListView:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res/LiivControl.Client.Droid"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <Mvx.MvxListView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        local:MvxBind="ItemsSource AutoListItems; ItemClick AutoListItemClicked"
        local:MvxItemTemplate="@layout/vbmvxautoviewlistitem" />
</LinearLayout>

Mein Artikelvorlagenlayout sieht wie folgt aus:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res/LiivControl.Client.Droid"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:paddingTop="10dip"
    android:paddingBottom="10dip"
    android:paddingLeft="15dip">
    <TextView
        android:id="@+id/list_complex_title"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge" />
    <TextView
        android:id="@+id/list_complex_caption"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>

Ich möchte die Bindungen für die beiden Textview-Elemente in meinem Itemtemplate aus dem Code dahinter festlegen. Ich bin mir nicht sicher, wie ich am besten vorgehen soll. Ich schätze, ich könnte etwas "OnViewModelSet" im Ansichtscode hinter der MvxListView machen. Ich habe Folgendes versucht, aber es funktioniert offensichtlich nicht, weil es das Steuerelement nicht finden kann.

protected override void OnViewModelSet()
    {
        IVbMvxAutoListViewModel vm = base.ViewModel as IVbMvxAutoListViewModel;

        TextView title = this.FindViewById<TextView>(Resource.Id.list_complex_title);
        this.CreateBinding(title).For(x => x.Text).To(vm.ListItemDescriptor.TitlePropName).Apply();

        TextView subTitle = this.FindViewById<TextView>(Resource.Id.list_complex_caption);
        this.CreateBinding(subTitle).For(x => x.Text).To(vm.ListItemDescriptor.SubTitlePropName).Apply();
        base.OnViewModelSet();
    }

Mein anderer Gedanke war, das oncreate für die Itemtemplate-Ansicht irgendwie abzufangen, aber OnCreate wird nicht aufgerufen, wenn ich eine View-Code-Datei für mein Itemtemplate-Layout erstelle.

Antworten auf die Frage(1)

Ihre Antwort auf die Frage