I'm trying to bind the header text of aGroupBox
to a property and display it using StringFormat
.
The first part works and it returns the text as expected. But I want the final text to be formatted. For example when I return cm
I want it to be displayed as Foundation Height (cm)
, but the code below only shows cm
.
<GroupBox Header="{Binding CurrentTargetUnit,
Converter={StaticResource QuantityToTextConverter},
ConverterParameter={x:Static enumerations:Quantity.Length},
StringFormat='Foundation Height ({0})'}">
</GroupBox>
Try without quotes
....
StringFormat=Foundation Height ({0})}">
UPDATE
As you have used binding for header you should use HeaderStringFormat
instead.
....
HeaderStringFormat=Foundation Height ({0})}">
Read the documentation for more
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