For example, I have the label:
<Label Content="{Binding SiteName, StringFormat={}{0} | }" />
The content of the label should appear as: “A Site Name | “. However, the spaces are omitted, as is the vertical bar.
I tried escaping the bar with the carat (^) as mentioned in another resource, but that didn’t work. Does anybody know how to do this?
Use a
TextBlockinstead of aLabel(if you want to be sure the spaces are taken into account :
Or, use the
ContentStringFormatproperty of theLabelinstead ofStringFormat.