Question

I'm attempting to use the "new" binding code for ReactiveUI and when I do wire my view model property to my control I get the following error:

Additional information: Can't two-way convert between <type1> and <type2>. To fix this, register a IBindingTypeConverter

So... how do I register an IBindingTypeConverter ? I'm struggling to find an comprehensible example.


n.b. the code that's throwing the error is not relevant to this question, it may in itself be wrong but that is an entirely different issue

Was it helpful?

Solution

The way to do it is via Splat's service locator:

Locator.CurrentMutable.RegisterConstant(
    new MyCoolTypeConverter(), typeof(IBindingTypeConverter));

Update: If you're using RxUI 5.x, it's "RxApp.CurrentMutable"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top