private void FixupInvoices(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.NewItems != null)
{
foreach (Invoice item in e.NewItems)
{
item.CustomerRef = this;
}
}
if (e.OldItems != null)
{
foreach (Invoice item in e.OldItems)
{
if (ReferenceEquals(item.CustomerRef, this))
{
item.CustomerRef = null;
}
}
}
}