I have a CheckListBox that is bound to my view model. The ItemsSource is updating properly, but I am unable to retrieve the selected/checked items in my view model. Any suggestions?
Xaml:
<syncfusion:CheckListBox IsCheckOnFirstClick="True" Grid.Row="2" VerticalAlignment="Stretch" ItemsSource="{Binding FilteredSymbols}" SelectedItems="{Binding SelectedSymbols}" DisplayMemberPath="BaseAsset">
<syncfusion:CheckListBox.ItemContainerStyle>
<Style TargetType="syncfusion:CheckListBoxItem">
<Setter Property="IsSelected" Value="{Binding IsChecked, Mode=TwoWay}"/>
</Style>
</syncfusion:CheckListBox.ItemContainerStyle>
</syncfusion:CheckListBox>
View Model:
private ObservableCollection<BinanceSymbol> selectedSymbols = new ObservableCollection<BinanceSymbol>();
private ObservableCollection<BinanceSymbol> filteredSymbols = new ObservableCollection<BinanceSymbol>();
public ObservableCollection<BinanceSymbol> SelectedSymbols
{
get { return selectedSymbols; }
set { selectedSymbols = value; RaisePropertyChangedEvent(nameof(SelectedSymbols)); }
}
public ObservableCollection<BinanceSymbol> FilteredSymbols
{
get { return filteredSymbols; }
set { filteredSymbols = value; RaisePropertyChangedEvent(nameof(FilteredSymbols)); }
}