1
我有一個項目模板,它將顯示一個List<IGrouping<string, string>>
。爲了做到這一點,我需要將ItemsSource
綁定到當前的綁定上下文中,在WPF中,我會這樣做,就像{Binding DataContext}
我該如何在MvvmCross中執行此操作?綁定到當前的綁定上下文?
<?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:layout_width="fill_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
local:MvxBind="Text Key"/> !**IGrouping.Key**!
<Mvx.MvxLinearLayout
android:id="@+id/items"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
local:MvxBind="ItemsSource DataContext" !**This doesn't work, should bind IGrouping as IEnumerable<string>**!
local:MvxItemTemplate="@layout/item_myitem"/>
</LinearLayout>