void InternalCollectionChanged(object sender, NotifyCollectionChangedEventArgs args) { if (args.Action == NotifyCollectionChangedAction.Reset) { var items = new List <object>(); for (int n = 0; n < internalCollection.Count; n++) { items.Add(internalCollection[n]); } args = new ResetNotifyCollectionChangedEventArgs(items); } /* * if (Device.IsInvokeRequired) * { * Device.BeginInvokeOnMainThread(() => HandleCollectionChange(args)); * } * else * { * HandleCollectionChange(args); * } */ HandleCollectionChange(args); }
void InternalCollectionChanged(object sender, NotifyCollectionChangedEventArgs args) { if (args.Action == NotifyCollectionChangedAction.Reset) { var items = new List <object>(); for (int n = 0; n < _internalCollection.Count; n++) { items.Add(_internalCollection[n]); } args = new ResetNotifyCollectionChangedEventArgs(items); } _dispatcher.DispatchIfRequired(() => HandleCollectionChange(args)); }