I have a custom combobox a multiselectioncombobox if you will,
the thing is the selections depend on an other collection. I tried to bind ComboBox.IsChecked property to MultiBinding Converter but the converter isn't called.
<DataTemplate>
<StackPanel Orientation="Horizontal" x:Name="ItemStack" VirtualizingStackPanel.IsVirtualizing="False">
<CheckBox x:Name="CheckBoxItem"
Command="{Binding SelectItem, RelativeSource={RelativeSource AncestorType={x:Type MultiSelectionComboBox}}}"
CommandParameter="{Binding Key}"
>
<CheckBox.IsChecked>
<MultiBinding Converter="{StaticResource MultiSelectionCommandConverter}" Mode="OneWay">
<Binding Path="Key"/>
<Binding Path="SelectedItem"
RelativeSource="{RelativeSource AncestorType={x:Type MultiSelectionComboBox}}" />
</MultiBinding>
</CheckBox.IsChecked>
</CheckBox>
<TextBlock Text="{Binding DisplayText}"></TextBlock>
</StackPanel>
</DataTemplate>
and the converter is,
public class MultiSelectionCommandConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
///stuff to do...
}
public object[] ConvertBack(object values, Type[] targetTypes, object parameter, CultureInfo culture)
{
return null;
}
}
any suggestions?