Is there any easy way to bind to the ToString() method in a DataTemplate? I would expect the Text property of a TextBlock to use ToString() by default for its Text property, but that does not happen. So any easy way to do this:
<DataTemplate x:Key="myTemplate"> <TextBlock Text="{Binding ToString()}"/> <DataTemplate>
You can use Text="{Binding}"
. The ToString()
method is invoked implicitly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With