我已經在Android中創建了MvxListView。我將它綁定到ObservableCollection。MvxListView - 模板內的按鈕
一切工作正常。即使SelectedItem命令正確觸發。問題是當我在每個項目中添加按鈕時。
我的列表包含帶有按鈕的圖像,以便互相刪除。
有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>
這是真的,因爲stranbe照片和評論性具有約束力。
public MvxCommand RemoveCommand { get; set; }
但是RemoveCommand does not fires。有任何想法嗎?
編輯:
當我add命令我的模型及其工作這就是爲什麼特性結合。那麼我怎麼能在ViewModel不是Model中存檔事件?
在XAML中,我可以綁定祖先數據上下文嗎?