Hello,
I have a ListView. The ItemSource is bind to a ObservableCollection.
ListView:
<ListView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="..."
xmlns:util="..."
ItemsSource="{Binding Items, Converter={StaticResource ManipulateItems}}"
ItemTapped="DataListOverviewOnItemTapped">
<ListView.Resources>
<ResourceDictionary>
<util:ItemsConverter x:Key="ManipulateItems" />
</ResourceDictionary>
</ListView.Resources>
(...)
ObservableCollection:
public ObservableCollection<DetailInfoItem> Items
{
get { return _items ?? (_items = new ObservableCollection<Item>()); }
}
ItemsConverter:
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
System.Diagnostics.Debug.WriteLine("Converted!");
}
This is working perfect for first time.
But when I update the ObservableCollection:
Items.Clear();
Items.Add(..)
The updated Items will displayed, but without converting. The Converter is not running on update of ObservableCollection. I don't uderstand why.
How can I fix it?
Thanks.