Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to get this result:

John has a red farm in Oslo.
XML
<TextBlock Grid.Row="0" Grid.Column="0" TextWrapping="Wrap">
     <TextBlock.Text>
          <MultiBinding StringFormat="- John has a {0} {1} in {2}.">
               <Binding Path="ColorName"/>
               <Binding Path="BuildingName"/>
               <Binding Path="LocationName"/>
          </MultiBinding>
     </TextBlock.Text>
</TextBlock>

But I don't know how to get the variable words in bold.

I'm open for any suggestions, even if they completely differ from my code. All I want is the desired result and it has to be translateable.

Thanks for any suggestions.
Posted
Updated 25-Jun-10 5:10am
v3

Found a post here - just one solution is given there but it might help.

You could actually use multiple text blocks - some bold and others normal to display data.
 
Share this answer
 
v2
Comments
Donnie Darko2 28-Jun-10 3:46am    
Reason for my vote of 3
Thanks for trying to help. Unfortunatly it's not a solution to my specifi problem.
Donnie Darko2 29-Jun-10 5:54am    
I'm also using MVVM pattern.

The solution you linked with the span's in the middle is the same as cutting up the sentance with multiple text blocks. This is how I'm doing it now, but the problem is translation.

Translating "John has a" and "in" seperately will give wrong results in some languages.

To make it clear for the translaters I need to keep the sentance as: "John has a X1 X2 in X3." With explenations about the Xx.
You can't do it in a single TextBlock control.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900