I have custom control that takes a list of object and present them in sort of listview.
public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create(nameof(ItemsSource), typeof(IEnumerable<object>), typeof(MyCustomControl), null);
public IEnumerable<object> ItemsSource
{
get { return (IEnumerable<object>)GetValue(ItemsSourceProperty); }
set{ SetValue(ItemsSourceProperty, value);}
}
From the ViewModel
I would be binding the ItemsSource
to an ObservableCollection<object>
and I would like my custom control to listen to the collectionchanged event on the ObservableCollection rather than propertychanged.
ListView some how able to listen to the collection changed and refreshes its view, I tried to find the code from the Xamarin github, no luck in finding where the listener is binded.
Any solution, how I can listen to the collection from my custom control?