I get a NotSupportedException (Unsupported expression type: 'Constant') when attempting to use a basic WhenAny or WhenAnyValue in a WP8 application. Am I missing something?
@TeaMax Can you show a code sample?
Maybe it's something I'm doing. Here's an example below.
``` C#
public class MainViewModel : ReactiveObject
{
public PasswordViewModel PasswordViewModel { get; private set; }
public MainViewModel()
{
PasswordViewModel = new PasswordViewModel();
}
}
public class PasswordViewModel : ReactiveObject
{
public ToggleState ToggleState { get; private set; }
public PasswordViewModel()
{
ToggleState = new ToggleState();
this.WhenAnyValue(x => ToggleState.Toggled)
.Subscribe(x => Debug.WriteLine("Test"));
}
}
public class ToggleState : ReactiveObject
{
private bool _toggled;
public bool Toggled
{
get { return _toggled; }
set { this.RaiseAndSetIfChanged(ref _toggled, value); }
}
}
```
Your expression should be x => x.ToggleState
Oh! Dang it, I knew that too. My bad. Thanks Paul!
Most helpful comment
Your expression should be
x => x.ToggleState