9

I want to 1. from the following image:

My code is here:

<WrapPanel>
    <TextBlock Text="Title: " Style="{StaticResource Title}" TextWrapping="Wrap" />
    <TextBlock Text="{Binding Description" Style="{StaticResource Normal}" TextWrapping="Wrap" />
</WrapPanel>

But if Description text is short, shown like 2., if Description text is long, shown like 3.

How to do this like 1.?

double-beep
  • 5,031
  • 17
  • 33
  • 41
ebattulga
  • 10,774
  • 20
  • 78
  • 116

2 Answers2

8

I have solve my question using Run:

<TextBlock TextWrapping="Wrap"> 
    <Run Text="Title: " Style="{StaticResource TitleRun}"/>
    <Run Text="{Binding Description,Mode=OneWay}" Style="{StaticResource NormalRun}"/>                                
</TextBlock>
double-beep
  • 5,031
  • 17
  • 33
  • 41
ebattulga
  • 10,774
  • 20
  • 78
  • 116
0

Just keep adding them to the Grid with 2 columns and n number of rows, adding new rows/colls as you add them.

You can create a behaviour for that.

double-beep
  • 5,031
  • 17
  • 33
  • 41
  • The problem is that there should be one non-rectangular TextBlock that wraps around another one. – H.B. Nov 23 '11 at 10:35
  • A custom panel then?:) Should it act like auto wrap? –  Nov 23 '11 at 10:36
  • Am I right in saying that text of the individual textboxes mustn't be wrapped? –  Nov 23 '11 at 11:05