When using a string value as Content
of a ContentControl (like Label), using an _
inside the string allows using the following letter as access key, like this:
<Label Content="Text with _access key"/>
or even
<Label Content="{Binding Text}"/>
if Text is a string property containing an _
.
However, when using ContentStringFormat
which contains the _
, it doesn't work any more:
<Label Content="{Binding Value}" ContentStringFormat="_Formatted value {0}"/>
I have seen in the debugger that no AccessText
is used in this case.
As a workaround, I have used AccessText
explicitly:
<Label>
<AccessText Text="{Binding Value, StringFormat=_Formatted value {0}"/>
</Label>
It works that way but I still want to know why it doesn't when using ContentStringFormat
.