I am hoping someone can help me out with this. I have asked a similar question before but I didn't have anything started on this at the time. I have found the SO question link
that is similar to my problem but it has one issue. The combobox doesn't show the selected enums. I do the example in the link working in my sample app but I have no clue how to get the Combobox's text to show the currently selected item(s). Anyone have a suggestion on what to do? I am real stuck on this one.
Here is my current combobox:
<ComboBox>
<CheckBox Content="SAW" IsChecked="{Binding Path=CurWeldingProcess, Converter={StaticResource wpFlagValueConverter}, ConverterParameter={x:Static models:WeldingProcess.SAW}}" />
<CheckBox Content="FCAW" IsChecked="{Binding Path=CurWeldingProcess, Converter={StaticResource wpFlagValueConverter}, ConverterParameter={x:Static models:WeldingProcess.FCAW}}" />
<CheckBox Content="SMAW" IsChecked="{Binding Path=CurWeldingProcess, Converter={StaticResource wpFlagValueConverter}, ConverterParameter={x:Static models:WeldingProcess.SMAW}}" />
</ComboBox>
My Converter is:
public class WeldingProcessFlagValueConverter : IValueConverter
{
private WeldingProcess target;
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
WeldingProcess mask = (WeldingProcess)parameter;
this.target = (WeldingProcess)value;
return ((mask & this.target) != 0);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
this.target ^= (WeldingProcess)parameter;
return this.target;
}
}
So my 'CurWeldingProcess' is showing the correct value when I select any combination of the checkboxes, but I dont know how to get the combobox to show the selected values ('CurWeldingProcess'). Any ideas?