I have this layout:
<cirrious.mvvmcross.binding.droid.views.MvxListView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:id="@+id/accountList" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" local:MvxItemTemplate="@layout/accountlistitem" local:MvxBind="ItemsSource AllAccounts" />
The layout is loaded into the fragment using this code:
public new AccountListViewModel ViewModel { get { return (AccountListViewModel)base.ViewModel; } set { base.ViewModel = value; } } public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { var ignore = base.OnCreateView(inflater, container, savedInstanceState); return this.BindingInflate(Resource.Layout.AccountListLayout, null); }
And in my ViewModel model (Changed property is introduced via fody):
public ObservableCollection<Account> AllAccounts { get { return accountRepository.Data; } set { accountRepository.Data = value; } }
This will not work and will not show any data. But when I add the following fragments to the fragment, my data is displayed correctly:
var list = view.FindViewById<MvxListView>(Resource.Id.accountList); list.ItemsSource = ViewModel.AllAccounts;
In another example, this worked without problems in the stable version. Also, binding seems to work in activity, but not in fragment. For this project, I am using v4.0.0 beta2. Did I miss something?
GitHub repository link: https://github.com/NPadrutt/MoneyManager
thanks
source share