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

Redrawing when data changes

$
0
0

(Forgive me if this is a repeat post, but I don't see it already posted)

Problem: Data changes but ListView does not update

I have a ListView whose ItemsSource is set to

<ListView ItemsSource="{Binding ContactsGrouped}" 

On click of a button I update the query to only return records that contain the letters "Je". I can see that the right thing is being returned, and that ContactsGrouped is being updated, but the UI does not change.

public ObservableCollection<Grouping<string, Contact>> ContactsGrouped { get; set; }

where Grouping looks like this:

public class Grouping<K, T> : ObservableCollection<T>
{
    public K Key { get; private set; }

    public Grouping ( K key, IEnumerable<T> items )
    {
        Key = key;
        foreach ( var item in items )
            this.Items.Add( item );
    }
}

Given that I'm using ObservableCollections, I'd expect the list to redraw. Am I missing something obvious?


Viewing all articles
Browse latest Browse all 58056

Trending Articles