I am trying to use Xceed CheckComboBox and it works well except for a small issue. When the CheckComboBox is initially loaded, the selected items List is shown properly in the ToggleButton part of the CheckComboBox, but the checkboxes representating these items aren't checked. Here is the code that I am using
XAML
<xctk:CheckComboBox x:Name="_combo" Grid.Row="2" Grid.Column="1"
ItemsSource="{Binding RoomFacilities}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
DisplayMemberPath="FacilityName"
SelectedItemsOverride="{Binding SelectedFaclities}"
/>
View Model
public class RoomBandUpdateViewModel : Screen, IHandle<RecordChanged<RoomFacility>>,
IHandle<RecordDeleted<RoomFacility>> {
private ObservableCollection<RoomFacility> _roomFacilities;
public ObservableCollection<RoomFacility> RoomFacilities {
get { return _roomFacilities; }
set { _roomFacilities = value; NotifyOfPropertyChange(() => RoomFacilities); }
}
private ObservableCollection<RoomFacility> _selectedFacilities;
public ObservableCollection<RoomFacility> SelectedFaclities {
get { return _selectedFacilities; }
set { _selectedFacilities = value; NotifyOfPropertyChange(() => SelectedFaclities); }
}
protected override void OnActivate() {
SelectedFaclities = new ObservableCollection<RoomFacility>(RoomBand.Facilities);
RoomFacilities = new ObservableCollection<RoomFacility>(facilityService.GetAll());
}
}
I would like to know why, when SelectedFacilities are set properly in view model, the CheckComboBox's checkboxes are not checked according to the items in the SelectedFacilities. The interesting part is that the Toggle Button part of the CheckComboBox properly displays SelectedFacilities in comma separated list.