1

I have this StringFormat StringFormat={}{0:#,0}} that represent decimal numbers and I want add text of my own after this number.

This is what I have tried (but it does not compile with the text inside the StringFormat)

Content="{Binding Path=(my:MyClass.MyStaticProperty),StringFormat={}{0:#,0}} My Text"

my:MyClass.MyStaticProperty is integer type.
Harry
  • 83,910
  • 24
  • 185
  • 203
user979033
  • 4,180
  • 5
  • 28
  • 43

1 Answers1

0

As you use Label, Content cannot be formatted with StringFormat. Please view this topic.

Your solution is to use ContentStringFormat:

<Label Content="{Binding Source={x:Static my:MyClass.MyStaticProperty}}"
       ContentStringFormat="{}{0:#.0} My Text"/>
Community
  • 1
  • 1
keymusicman
  • 1,271
  • 1
  • 10
  • 20