How to wrap multiple textbox wrap together?
Asked Answered
S

2

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.?

Shela answered 23/11, 2011 at 10:18 Comment(1)
WrapPanels won't do that, i can tell you that much.Idiopathy
S
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>
Shela answered 23/11, 2011 at 11:14 Comment(0)
H
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.

Hilda answered 23/11, 2011 at 10:30 Comment(3)
The problem is that there should be one non-rectangular TextBlock that wraps around another one.Idiopathy
A custom panel then?:) Should it act like auto wrap?Hilda
Am I right in saying that text of the individual textboxes mustn't be wrapped?Hilda

© 2022 - 2024 — McMap. All rights reserved.