Search code examples
c#wpfwrappanel

How to wrap multiple textbox wrap together?


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


Solution

  • 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>