Converters are often useful when you want to perform data binding between two properties that have incompatible types. In such cases, you will need a piece of code which creates a bridge between source and target. This piece of code is defined as a value converter.
The IValueConverter interface is used to create value converters and contains two methods named Convert and ConvertBack:
- Convert(...): It gets called when the source updates the target object
- ConvertBack(...): It gets called when the target object updates the source object
In this recipe, we will learn how to create value converters and use them while data binding.