I am trying to get a simple skeleton ViewModel set up with ReactiveUI 6 (beta) and keep getting compiler errors (in Xamarin Studio, FWIW).
Code:
using System;
using System.Reactive;
using System.Reactive.Linq;
using ReactiveUI;
// ...
public IReactiveCommand TryAuthenticateCommand { get; protected set; }
// ...
this.TryAuthenticateCommand = ReactiveCommand.Create(
this.WhenAny(
x => x.Username,
x => x.Password,
(username, password) =>
!string.IsNullOrWhiteSpace(username.Value) &&
!string.IsNullOrWhiteSpace(password.Value)));
this.TryAuthenticateCommand.Subscribe(x => MessageBus.Current.SendMessage("Yes!"));
Error:
Error CS0411: The type arguments for method `System.ObservableExtensions.Subscribe<T>(this System.IObservable<T>, System.Action<T>)' cannot be inferred from the usage. Try specifying the type arguments explicitly (CS0411)