0

Trying to see xamarin.Forms and ReactiveUI playing nicely together and I run into the following error when trying to bind to a xamarin.form button

Couldn't find a Command Binder for Xamarin.Forms.Button

using this code:

this.BindCommand (ViewModel, vm => vm.Register, v => v.register);

Am I missing something or do I need to do some special binding for these new xamarin.forms controls?

Chuck Pinkert
  • 1,325
  • 1
  • 14
  • 24

1 Answers1

2

It works, but support is brand new - you need to build ReactiveUI from source at the moment and include the new ReactiveUI.XamForms.dll assembly.

Ana Betts
  • 73,868
  • 16
  • 141
  • 209
  • Thanks for your answer. I am currently referencing it but I still receive the same error. I have access to everything in the ReactiveUI.XamForms namespace so that should confirm I have the correct dll imported – Chuck Pinkert Jun 09 '14 at 04:16
  • I think you're probably referencing the wrong DLLs in your project. Make sure the iOS Xamforms app is referencing both the iOS version of RxUI.dll and the RxUI.Xamforms.dll assemblies, and the PLib (if you have one) refs the PLib RxUI.dll and PLib RxUI.Xamforms.dll - Once these are NuGet packages, you don't have to think about any of this stuff, but right now you gotta – Ana Betts Jun 09 '14 at 05:48
  • Looks like you're right, I'm referencing the PCL version of RxUI.Xamforms.dll :/ – Chuck Pinkert Jun 09 '14 at 18:41
  • Ah sorry, there is *only* a PCL version of RxUI.XamForms.dll, but you need the iOS version of ReactiveUI.dll – Ana Betts Jun 09 '14 at 18:47
  • Gotcha, I am referencing the ios version of the RxUI.dll (via nuget). I can bindCommand on objects like UIButtons fine, but the Xamarin.Forms.Button is giving that error. Is it perhaps that there is n't a default command binding setup for Xamarin.Forms.Button.Clicked? – Chuck Pinkert Jun 09 '14 at 18:53
  • If you're using RxUI.dll from NuGet it definitely won't work, you need to use everything from source until RxUI 6.0 final comes out (which is very soon) – Ana Betts Jun 09 '14 at 20:32
  • Using 5.99.6 or something like that in the pre-release channel. Thanks for all your help – Chuck Pinkert Jun 09 '14 at 20:41
  • If you're using any released NuGet version, it's the wrong one, it's **only** available via source and you cannot use any binaries from any RxUI NuGet package (Yet! Not permanently of course!) – Ana Betts Jun 09 '14 at 21:03