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

New Post: CheckComboBox selectedItems

$
0
0
Actually, it's not just the 1st time. It keeps not calling CheckComboBox's Command Property's Bound ICommand (OnUserGroupTypeToggledCommand) until I actually toggle an item in the CheckComboBox via the UI. I don't know if this makes a difference but here are a few differences between yours and my code:
  1. My SelectedItemsOverride's Bound Property's Backing Variable (selectedUserGroupTypesOverride) is initialized to an empty ObservableCollection<UserGroupType> at the View Model's Class level first.
  2. I have an "All" Checkbox whose IsChecked Property I set to true in the Window's Loaded Event Handler which results in calling the Setter of its Bound Property (UserGroupTypesAllChecked). That Setter first calls SelectedItemsOverride's Bound Property (SelectedUserGroupTypesOverride)'s Clear Method (which, btw, does Raise the Backing Variable (selectedUserGroupTypesOverride)'s CollectionChanged Event with an NotifyCollectionChangedEventArgs.Action of Reset). That Clear Method, as expected, doesn't result in a call to OnUserGroupTypeToggledCommand, because prior to the Clear Method call (after the first time I set the "All" Checkbox's IsChecked to true), no items were selected.
  3. However, when I subsequently call SelectedItemsOverride's Bound Property (SelectedUserGroupTypesOverride)'s Add Method to add each of all possible items each call to which I would've expected to result in a call to OnUserGroupTypeToggledCommand, it doesn't (even after repeated toggling of "All" Checkbox via the U.I.) - UNTIL I actually toggle an item off / on in the CheckComboBox via the UI!?! Afterwards, the OnUserGroupTypeToggledCommand gets called as expected for every single item whenever I toggle the "All" Checkbox on/off in the U.I..

Viewing all articles
Browse latest Browse all 4964

Trending Articles



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