private void parentItemsChanged()
{
ItemCollection newParentItems = (ItemCollection)GetValue(ParentItemsInternalProperty);
if (newParentItems != ParentItems)
{
if (ParentItems != null)
{
INotifyCollectionChanged incc = ParentItems as INotifyCollectionChanged;
incc.CollectionChanged -= parentItemsContentChanged;
}
if (newParentItems != null)
{
INotifyCollectionChanged incc = newParentItems as INotifyCollectionChanged;
incc.CollectionChanged += parentItemsContentChanged;
}
ParentItems = newParentItems;
resetParentItems();
}
}