I have a ComboBox with CheckBoxes for items. When the user checks or deselects the checkboxes, I want the selected values to appear in ContentPresenter, separated by a comma. Currently, I have redefined ContentPresenter:
<ContentPresenter x:Name="ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ContentTemplate="{StaticResource SelectedOperationsText}"/>
ContentPresenter is by default part of the ComboBox style. Any tips on how to implement this feature?
ComboBox ItemTemplate is implemented as follows:
<DataTemplate x:Key="ComboItemTemplate">
<Grid HorizontalAlignment="Left">
<CheckBox IsChecked="{Binding IsChecked}" Content="{Binding Text}"/>
</Grid>
</DataTemplate>
source
share