{
prevNotifyCollectionChanged.CollectionChanged -= CollectionChanged;
}
- itemsLayouter.Clear();
+ itemsLayouter?.Clear();
if (selectedItem != null) selectedItem = null;
- if (selectedItems != null)
- {
- selectedItems.Clear();
- }
+ selectedItems?.Clear();
}
itemsSource = value;
if (value == null)
{
- if (InternalItemSource != null) InternalItemSource.Dispose();
+ InternalItemSource?.Dispose();
+ InternalItemSource = null;
//layouter.Clear()
return;
}
newNotifyCollectionChanged.CollectionChanged += CollectionChanged;
}
- if (InternalItemSource != null) InternalItemSource.Dispose();
+ InternalItemSource?.Dispose();
InternalItemSource = ItemsSourceFactory.Create(this);
if (itemsLayouter == null) return;