Ich habe MvxListView in Android erstellt. Ich verbinde es mit ObservableCollection.MvxListView - Schaltfläche in der Vorlage
Alles funktioniert gut. Selbst SelectedItem Command wird korrekt ausgelöst. Das Problem ist, wenn ich Knopf innerhalb jedes Artikels hinzufüge.
Meine Liste enthält Bilder mit Schaltflächen zum Entfernen voneinander.
Es gibt item_photo.axml
<LinearLayout
android:id="@+id/titleLinearLayout"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:background="@color/icons"
android:orientation="horizontal">
<TextView
android:id="@+id/DepartureDateTitleTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
local:MvxBind="Text Comment"
android:textColor="@color/primary"
android:textSize="17dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
local:MvxBind="Bitmap NativeReference, Converter=ObjectToBitmap, FallbackValue=''"/>
</LinearLayout>
<LinearLayout
android:id="@+id/titleLinearLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@color/icons"
android:orientation="horizontal">
<Button
android:id="@+id/PriceTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Remove"
android:textColor="@color/accent"
android:textSize="17dp"
local:MvxBind="Click RemoveCommand" />
</LinearLayout>
Das ist wirklich stranbe weil Foto und Kommentar Eigenschaften sind verbindlich.
public MvxCommand RemoveCommand { get; set; }
Allerdings entfernt RemoveCommand nicht. Irgendwelche Ideen?
EDIT:
Wenn ich hinzufügen Befehl zu meinem Modell seiner Arbeits das ist, warum Eigenschaften sind verbindlich. Wie kann ich dann in ViewModel not Model Events erstellen?
In XAML konnte ich Vorfahren Datenkontext binden ist es dort möglich?