Any default converters for WPF?

I read that I can use data converters in binding, for example ...

<TextBlock Text="{Binding Converter={StaticResource PositionConverter}}" /> 

from here

but I am wondering if there are any built-in converters. because creating converters for output only means 2 decimal places, etc. seem troublesome. I just thought that there should be sometime inline, what can I use?

+6
data-binding wpf
source share
2 answers

For a list of built-in converters, see commanderz answer

creating converters to output only 2 decimal places, etc. seems difficult

In fact, and you do not need;)

Instead, you can use the StringFormat property to specify a format specifier:

 <TextBlock Text="{Binding SomeValue, StringFormat=F2}" /> 

For more information on formatting and lists of valid format specifiers, see this page .

+6
source share
+9
source share

All Articles