Ethan Arbuckle
Ethan Arbuckle

Reputation: 53

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?

Upvotes: 3

Views: 1062

Answers (1)

bartosz.lipinski
bartosz.lipinski

Reputation: 2667

If it's XAML you could use StringFormat

<TextBox Text="{Binding Path=data.author, StringFormat=Author: {0}}"/>

Upvotes: 3

Related Questions