0

I'm trying to format display the following text using StringFormat in XAML, but I don't know where to enter the "Current Temperature: " string here:

<TextBlock Text="{Binding TempText, StringFormat={"Current Temperature: "}{0}°C}" 

The final output should be:

Current Temperature: 10°C
Frédéric Hamidi
  • 249,845
  • 40
  • 466
  • 467
Vahid
  • 4,690
  • 11
  • 61
  • 131

2 Answers2

3

The following code gives you the required output.

<TextBlock Text="{Binding TempText, StringFormat='Current Temperature: {0} &#186; C'}"/>
Jawahar
  • 4,428
  • 23
  • 46
0

You may use MultiBinding along with StringFormat

this msdn may help:

"http://msdn.microsoft.com/en-us/library/system.windows.data.bindingbase.stringformat%28v=vs.110%29.aspx"

MBDevelop
  • 103
  • 1
  • 11