How to wrap multiple text fields together?

I want 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 the Description text is short, it is displayed as 2. , if the Description text is long, it is displayed as 3.

How to do it like 1. ?

+6
source share
2 answers

I solved my question using Run :

 <TextBlock TextWrapping="Wrap"> <Run Text="Title: " Style="{StaticResource TitleRun}"/> <Run Text="{Binding Description,Mode=OneWay}" Style="{StaticResource NormalRun}"/> </TextBlock> 
+7
source

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

You can create behavior for this.

0
source

Source: https://habr.com/ru/post/902187/


All Articles