I have a number of check lists held in ReactiveLists
that have ChangeTrackingEnabled = true
. I want to only enable my OkCommand when there is at least one item checked in each list.
In addition there are various other properties that I want to ensure are filled in with a valid byte value.
I've tried doing the following but it doesn't work:
this.OkCommand = new ReactiveCommand(this.WhenAny(
x => x.Property1,
x => x.Property1,
x => x.Property1,
x => x.List1,
x => x.List2,
x => x.List3,
(p1, p2, p3, l1, l2, l3) =>
{
byte tmp;
return byte.TryParse(p1.Value, out tmp) &&
byte.TryParse(p2.Value, out tmp) &&
byte.TryParse(p3.Value, out tmp) &&
l1.Value.Any(x => x.IsChecked) &&
l2.Value.Any(x => x.IsChecked) &&
l3.Value.Any(x => x.IsChecked);
}));
It seems the property change notifications aren't being propagated to WhenAny. Any idea what I should be doing?