Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set TextBlock's text to string plus binding item?

I have a ListView with multiple TextBlocks in it. Is it possible to have something such as this?

TextBlock x:Name="AuthorInfo" Text="Author: {Binding data.author}"

or would it be better to just add it to data.author when that is set?

like image 400
Ethan Arbuckle Avatar asked Dec 05 '25 12:12

Ethan Arbuckle


1 Answers

If it's XAML you could use StringFormat

<TextBox Text="{Binding Path=data.author, StringFormat=Author: {0}}"/>
like image 132
bartosz.lipinski Avatar answered Dec 08 '25 00:12

bartosz.lipinski



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!