Pergunta

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

Foi útil?

Solução

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"

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top