How can I emphasize the value of the data binding from the DataTemplate?
If I want to display the underlined value in the TextBlock, I have to use the Run element. (If there is a better / easier way, I'd love to hear about it.)
<TextBlock>
<Run TextDecorations="Underline" Text="MyText" />
</TextBlock>
Ideally, to implement this in a DataTemplate, it would look something like this:
<DataTemplate x:Key="underlineTemplate">
<TextBlock>
<Run TextDecorations="Underline" Text="{Binding Value}" />
</TextBlock>
</DataTemplate>
This won't work because the Run Text property is not a DependencyProperty, so you cannot bind to it. Does anyone know how I can do this?
0
source to share