xamltextblock

Two textblocks after each other


I have two textblocks and they are after each other on the page - name & surname. I am binding data to this so the size depends of the length of them. What's the best way to do them working with variable size?


Solution

  • <StackPanel Orientation="Horizontal">
       <TextBlock Text="{Binding FirstName}" Margin="0,0,5,0" />
       <TextBlock Text="{Binding LastName}" />
    </StackPanel>