Reputation: 88317
i read that i can use data converters in binding like ...
<TextBlock Text="{Binding Converter={StaticResource PositionConverter}}" />
from here
but i wonder if there are any "in-built" converters. because creating converters to just output say 2 decimal places etc seem troublesome. i just thought that there must be sometime inbuilt that i can use?
Upvotes: 6
Views: 5987
Reputation: 292615
For a list of built-in converters, see commanderz's answer
creating converters to just output say 2 decimal places etc seem troublesome
Indeed, and you don't need to ;)
Instead, you can use the StringFormat
property to specify a format specifier:
<TextBlock Text="{Binding SomeValue, StringFormat=F2}" />
See this page for details on formatting and lists of valid format specifiers.
Upvotes: 6
Reputation: 17272
Here is the list of all converters provided by the framework
Upvotes: 9