Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

New Post: CheckListBox SelectedItemsOverride binding not working

$
0
0
Hi,

From what I can see, the Collections are set to a value, but the get returns a new collection. I would suggest to initialize the collection when defining the variable, or in the get, if the variable is null, initialize it (for the 2 collections):
 private ObservableCollection<String> selectedTaskStatuses = new ObservableCollection<string>();
    public ObservableCollection<String> SelectedTaskStatuses
    {
      get
      {
        return selectedTaskStatuses;
      }
      set
      {
        selectedTaskStatuses = value;
      }
    }
Also, the setter will be called only if the entire collection is changed. If you want to be notified when items are selected/unselected (added/removed) from the collection, listen to the collectionChanged event :
this.SelectedTaskStatuses.CollectionChanged += SelectedTaskStatuses_CollectionChanged;

private void SelectedTaskStatuses_CollectionChanged( object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e )
    {
    }

Viewing all articles
Browse latest Browse all 4964

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>