Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

ListView visible itemSource only updated when interacted with

$
0
0

Hi folks,
i'm working with a listview in class created:

public MyPage()
{
          this.MyListView = new ListView()
          {
                IsGroupingEnabled = false,
                HasUnevenRows = true,
                ItemTemplate = new DataTemplate(typeof(MyViewCell)),
         };

        this.MyListView.SetBinding<MyViewModel>(ListView.ItemsSourceProperty, c => c.MyItemsSourceList);
        this.MyListView.ItemSelected += new EventHandler(OnMyListViewItemSelected);
        this.MyListView.SetBinding<MyViewModel>(ListView.IsVisibleProperty, c => c.MyIsListVisible);
    .
    .
    .
}

public override void OnAppearing()
{
    ((MyViewModel)this.BindingContext).MyItemsSourceList = businessObject.GetUpdatedList();
    base.OnAppearing();
}

although it works fine first 2 times, beyond that MyListView doens't update until you scroll it.

i've tryied many things and i cant figure it out.
I hope there is a wizard out there to stop this problems to pass :D Haha.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>