开发者

Silverlight for Windows phone 7 - two text blocks after each other with NO linebreak

开发者 https://www.devze.com 2023-02-14 16:31 出处:网络
I\'m relatively new to Windows Phone 7 development, so bear with me on this. I\'ve two tex开发者_运维百科t blocks, each with binding to two different properties, like this:

I'm relatively new to Windows Phone 7 development, so bear with me on this.

I've two tex开发者_运维百科t blocks, each with binding to two different properties, like this:

              <TextBlock Text="{Binding ID}" />
              <TextBlock Text="{Binding Title}"/>

So when I deploy this code, on the phone it will be something like this:

6
This is a title

I want the text to be displayed this way instead:

6: This is a title

What is the easiest way to achieve this?


 <TextBlock>
     <Run Text="{Binding ID}" />: 
     <Run Text="{Binding Title}"/>
 </TextBlock>


Three most common UI layout elements are StackPanel, Grid & Canvas. Here's one way..

 <StackPanel Orientation="Horizontal">
    <TextBlock .. />
    <TextBlock .. />
 </StackPanel>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号