Add other affectable change action cases

This commit is contained in:
Salman Ahmed 2021-06-11 11:34:22 +03:00
parent a985e3b8d3
commit 8132852753
1 changed files with 10 additions and 0 deletions

View File

@ -72,11 +72,21 @@ protected SkinProvidingContainer()
break;
case NotifyCollectionChangedAction.Reset:
case NotifyCollectionChangedAction.Remove:
foreach (var source in args.OldItems.Cast<ISkin>().OfType<ISkinSource>())
source.SourceChanged -= OnSourceChanged;
break;
case NotifyCollectionChangedAction.Replace:
foreach (var source in args.OldItems.Cast<ISkin>().OfType<ISkinSource>())
source.SourceChanged -= OnSourceChanged;
foreach (var source in args.NewItems.Cast<ISkin>().OfType<ISkinSource>())
source.SourceChanged += OnSourceChanged;
break;
}
}), true);
}