private void OnItemsSourceChanged(IEnumerable <IColorLegendItem> oldValue, IEnumerable <IColorLegendItem> newValue) { if (_changeNotificationWrapper != null) { _changeNotificationWrapper.CollectionItemPropertyChanged -= OnColorProviderPropertyChanged; _changeNotificationWrapper.UnsubscribeFromAllEvents(); _changeNotificationWrapper = null; } SetCurrentValue(FilteredItemsSourceProperty, GetFilteredItems()); SetCurrentValue(FilteredItemsIdsProperty, FilteredItemsSource?.Select(cp => cp.Id)); if (newValue != null) { _changeNotificationWrapper = new ChangeNotificationWrapper(newValue); _changeNotificationWrapper.CollectionItemPropertyChanged += OnColorProviderPropertyChanged; } UpdateIsAllVisible(); }
private void OnItemsSourceChanged(IEnumerable <IColorProvider> oldValue, IEnumerable <IColorProvider> newValue) { if (_changeNotificationWrapper != null) { _changeNotificationWrapper.CollectionItemPropertyChanged -= OnColorProviderPropertyChanged; _changeNotificationWrapper.UnsubscribeFromAllEvents(); _changeNotificationWrapper = null; } FilteredItemsSource = GetFilteredItems(); FilteredItemsIds = FilteredItemsSource == null ? null : FilteredItemsSource.Select(cp => cp.Id); if (newValue != null) { _changeNotificationWrapper = new ChangeNotificationWrapper(newValue); _changeNotificationWrapper.CollectionItemPropertyChanged += OnColorProviderPropertyChanged; } UpdateIsAllVisible(); }
private void OnFilterChanged() { SetCurrentValue(FilteredItemsSourceProperty, GetFilteredItems()); SetCurrentValue(FilteredItemsIdsProperty, FilteredItemsSource?.Select(cp => cp.Id)); }
private void OnFilterChanged() { FilteredItemsSource = GetFilteredItems(); FilteredItemsIds = FilteredItemsSource == null ? null : FilteredItemsSource.Select(cp => cp.Id); }