If you want to use a transformer, I think you will have to write it yourself, as in this example . It will register the class that defines the value transformer, which the system will then implement.
If you want to register an instance as a value converter, this document contains data. The advantage is that you can configure each instance differently without defining a class for each situation.
source share