I have an Listview who contains the following xml as list item:
<?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_marginTop="20dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left"
android:textAppearance="?android:attr/textAppearanceMedium"
local:MvxBind="Text Key" />
<MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerView
android:id="@+id/inner_payment_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
local:MvxItemTemplate="@layout/listitem_payment"
local:MvxBind="ItemsSource .;ItemClick ItemClickCommand; ItemLongClick ItemLongClickCommand" />
</LinearLayout>
View Model:
/// <summary>
/// Returns groupped related payments
/// </summary>
public ObservableCollection<DateListGroup<DateListGroup<PaymentViewModel>>> Source
{
get { return source; }
set
{
source = value;
RaisePropertyChanged();
// ReSharper disable once ExplicitCallerInfoArgument
RaisePropertyChanged(nameof(IsPaymentsEmtpy));
}
}
In my View Model I bind my items via an Observable Collection to the list and to the Recyclerview. This works so far. But when I scroll now, the recyclview displays the same items again. I can then scroll up and down again and mostly the correct items are displayed then. So somehow it seems it loads to slow. Is there a way to prevent that behaviour?