【发布时间】:2019-09-27 11:00:29
【问题描述】:
我整整两天都在试图弄清楚如何将数据和命令绑定到按钮或 listView 等布局元素,直到现在我还没有成功,这就是我所拥有的示例之一我的布局。
你能帮帮我吗?
<?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-auto"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minWidth="25px"
android:minHeight="25px">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/srlStores"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="80"
local:MvxBind="Refreshing IsBusy">
<MvxListView
android:minWidth="25px"
android:minHeight="25px"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/lvStores"
local:MvxBind="ItemsSource Stores; ItemClick OpenDetailCommand"
local:MvxItemTemplate="@layout/store_list_item" />
</android.support.v4.widget.SwipeRefreshLayout>
<ProgressBar
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="20"
android:id="@+id/progressBar1"
local:MvxBind="Visible IsBusy" />
<Button
android:text="@string/storeListCreateButtonText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/bCreate"
android:layout_weight="20"
local:MvxBind="Click CreateCommand" />
</LinearLayout>
【问题讨论】:
标签: xamarin data-binding xamarin.android mvvm-light