private void UnsubscribeNotifications(IEnumerable models)
{
if (models == null) {
foreach (INotifyPropertyChanged notifier in this.subscribedModels.Keys) {
notifier.PropertyChanged -= HandleModelOnPropertyChanged;
}
subscribedModels = new Hashtable();
} else {
foreach (object x in models) {
INotifyPropertyChanged notifier = x as INotifyPropertyChanged;
if (notifier != null) {
notifier.PropertyChanged -= HandleModelOnPropertyChanged;
subscribedModels.Remove(notifier);
}
}
}
}