Reputation: 5454
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
Upvotes: 0
Views: 1178
Reputation: 4885
The following code gives you the required output.
<TextBlock Text="{Binding TempText, StringFormat='Current Temperature: {0} º C'}"/>
Upvotes: 3
Reputation: 123
You may use MultiBinding along with StringFormat
this msdn may help:
Upvotes: 0