MonoMobile.Views.MemberData.ResetCollection C# (CSharp) Method

ResetCollection() private method

private ResetCollection ( INotifyCollectionChanged collection, IList newCollection ) : void
collection INotifyCollectionChanged
newCollection IList
return void
		private void ResetCollection(INotifyCollectionChanged collection, IList newCollection)
		{	
			if (collection != null)
			{
				var collectionChangedMethod = collection.GetType().GetMethod("OnCollectionChanged", BindingFlags.InvokeMethod | BindingFlags.NonPublic | BindingFlags.Instance);
				if (collectionChangedMethod != null)
				{
					collectionChangedMethod.Invoke(collection, new object[] { new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset, null) });
					collectionChangedMethod.Invoke(collection, new object[] { new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, newCollection) });

					SetDataContextBinder(DataContextBinder);
				}
			}
		}