Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wrap multiple textbox wrap together?

Tags:

c#

wpf

wrappanel

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

like image 451
ebattulga Avatar asked Nov 23 '11 10:11

ebattulga


1 Answers

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>
like image 127
ebattulga Avatar answered Oct 05 '22 03:10

ebattulga