using System.Collections.Specialized;
using System.Linq;
namespace Xamarin.Forms.Platform.Tizen.Native
{
///
/// Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed.
///
/// The type of elements in the collection.
internal class ObservableCollection : System.Collections.ObjectModel.ObservableCollection
{
///
/// Removes all items from the collection.
///
///
/// Fisrt remove all items, send CollectionChanged event with Remove Action
/// Second call ClearItems of base
///
protected override void ClearItems()
{
var oldItems = Items.ToList();
Items.Clear();
using (BlockReentrancy())
{
OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, oldItems));
}
base.ClearItems();
}
}
}