MvvMCross binds to <include> in android layout

Is it possible to associate an object Xwith an include tag so that the binding context is in the included layout X? I want to use the layout several times, but not on the list.

MainLayout.xml

...
<include
    android:id="@+id/btnDealerMap"
    android:layout_width="64dp"
    android:layout_height="64dp"
    android:visibility="gone"
    layout="@layout/ServiceBarButtonPhone" 
    local:MvxBind="??? X" />
...

ServiceBarButtonPhone.xml

Titleand Textare properties X.

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:local="http://schemas.android.com/apk/res/..."
    android:layout_width="96dp"
    android:layout_height="96dp">
    <TextView
        ...
        android:id="@+id/txtTitle"
        local:MvxBind="Text Title" />
    <TextView
        ...
        android:id="@+id/txtText"
        local:MvxBind="Text Text" />
</RelativeLayout>
+4
source share

Source: https://habr.com/ru/post/1528105/


All Articles