bind ViewModel is better than bind Model

#36 · closed · 1 comments

View on GitHub ↗

Michaelliu1989

In MVVM design mode, it's bad to attach View and Model. So it's any way to bind ViewModel? eg: `<layout xmlns:android="http://schemas.android.com/apk/res/android"> <data> <variable name="item" type="com.github.nitrico.lastadapterproject.item.Header"/> </data> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@{item.text}"/> </layout>` there is bind a Model Header,it's possible to bing a ViewModel like HeaderViewModel?

Comments

Michaelliu1989

I find the way already, thanks.