Reputation: 324
In, WPF, XAML, I have a Style that's being applied to the items of a ComboBox, I want to get the current item's Content Property but this doesn't seem to work:
<dxe:ComboBoxEdit.Items>
<Style TargetType="{x:Type dxe:ComboBoxEditItem}">
<Style.Setters>
<Setter Property="Content" Value="{Binding Converter={StaticResource CrsNameCvtor}, ConverterParameter={Binding Content,RelativeSource={RelativeSource Self}}}"/>
</Style.Setters>
</Style>
</dxe:ComboBoxEdit.Items>
Upvotes: 0
Views: 471
Reputation: 128061
The Style should be assigned to the ComboBox's ItemContainerStyle
property, and you don't need to set the Binding's ConverterParameter at all:
<dxe:ComboBoxEdit.ItemContainerStyle>
<Style TargetType="dxe:ComboBoxEditItem">
<Setter Property="Content"
Value="{Binding Converter={StaticResource CrsNameCvtor}}"/>
</Style>
</dxe:ComboBoxEdit.ItemContainerStyle>
Upvotes: 2