0

I have an integer value named Id and want a Label in Xaml to display the following:

(ID: 160)

I tried the following:

<Label Content="{Binding Id, StringFormat='(ID: {0:0})'} />

but it doesn't work - it just displays the value of Id:

160

How can I get this working without using a special ValueConverter class?

GreenEyedAndy
  • 1,485
  • 1
  • 14
  • 31

1 Answers1

0

You have to use ContentStringFormat for content controls instead of the binding's StringFormat, has been asked various times before, will have to look for that.

H.B.
  • 166,899
  • 29
  • 327
  • 400