I have been struggling to get this code below to work. The binding works but the ContentStringFormat in the first or StringFormat in the second one doesn't seem to work.
<RadioButton Content="{Binding ClientCode}" ContentStringFormat="{}{0} copy"
IsChecked="{Binding Path= FilterType,
Converter={StaticResource EBConverter},
ConverterParameter={x:Static wordMerge:FilterType.ClientCopy}}"
Width="90"/>
The above code just returns the binding value say "ABC" but I am expecting "ABC copy"
<RadioButton IsChecked="{Binding Path= FilterType,
Converter={StaticResource EBConverter},
ConverterParameter={x:Static wordMerge:FilterType.ClientCopy}}"
Width="90">
<RadioButton.Content>
<TextBlock Text="{Binding ClientCode, StringFormat={}{0} copy}"/>
</RadioButton.Content>
</RadioButton>
The above code not returning any values for binding.
Updated The string copy is not displayed during design time or at runtime in both cases.
Try this
StringFormat='{}copy {0}'}"
tested
<TextBlock Text="{Binding Path=Str, Mode=OneWay, StringFormat='{}{0} copy'}"/>
@Kiru it works for me
<RadioButton Content="{Binding Path=Str, Mode=OneWay}" ContentStringFormat='{}{0} copy'/>
<RadioButton>
<TextBlock Text="{Binding Path=Str, Mode=OneWay, StringFormat='{}{0} copy'}"/>
</RadioButton>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With