I couldn’t figure out a great way to title this post. Anyway, the issue I had was having a (none) value in the combobox but when it is selected show a blank combo. Those were the requirements and I wanted to do an easy solution without having to write a converter. Here is the solution using a simple style. Note, the StringResources line is where the source of the (none)string lives, You could just hard code this to your string if you aren’t pulling from a resource file.
Snippet :
<!-- Style for a combobox so that if the none value is picked, it will show up as a blank string.-->
<
Style
TargetType
=
"ComboBox"
BasedOn
"{StaticResource {x:Type ComboBox}}"
>
Setter
Property
"Foreground"
Value
"DarkBlue"
/>
"Margin"
"0,2,0,2"
"ItemTemplate"
Setter.Value
DataTemplate
TextBlock
Margin
"0"
TextBlock.Style
"TextBlock"
Style.Setters
"Text"
"{Binding}"
</
Style.Triggers
MultiDataTrigger
<!-- handle the display struct-->
MultiDataTrigger.Conditions
Condition
Binding
"{Binding RelativeSource={RelativeSource AncestorType=ComboBoxItem},FallbackValue={x:Null}}"
"{x:Null}"
"{Binding Text}"
"{x:Static StringResources:WorkProgram.NoneValue}"
MultiDataTrigger.Setters
" "