Can we concat two properties in data binding?

If you want to show, say FirstName and LastName, in a single TextBlock, then you can do like this:

<TextBlock>
     <Run Text="{Binding FirstName}" />
     <Run Text="   " /> <!-- space -->
     <Run Text="{Binding LastName}" />
</TextBlock>

Now, the TextBlock’s Text property will be "Sachin Tendulkar" and will be displayed if:

FirstName = Sachin
LastName  = Tendulkar

Leave a Comment

tech