Suraj
Suraj

Reputation: 433

Bind a List<string> to MvxListView in MvxActivity

I want to bind a List to MvxListView which is defined as property in one of my ViewModel class/ How can I do this?

Upvotes: 0

Views: 1161

Answers (1)

eMi
eMi

Reputation: 5628

In the markup .axml u define the ItemsSource

<Mvx.MvxListView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:textSize="20dp"
    local:MvxBind="ItemsSource MyStringList"/>

MyStringList is the List Property in your Viewmodel. INotifyPropertyChanged also needs to be implemented and the Activity itself must know it's viewmodel, there are lot of examples here

Upvotes: 2

Related Questions