ReactiveCommand not working when predicate refers to an ObservableAsPropertyHelper
I'm currently having a problem with a ReactiveCommand predicate (using ReactiveUI 6.2, in a WPF application). I have a property called LoggedIn, backed by an ObservableAsPropertyHelper, and it's defined like this :
someObservableThatReturnsBoolean
.ToProperty(this, x => x.LoggedIn, out _loggedIn)
I then have a ReactiveCommand that uses that property as a predicate :
var command = ReactiveCommand.Create(this.WhenAnyValue(x => x.LoggedIn))
However, when LoggedIn becomes false, the command may still be executed. If I changed LoggedIn to be a regular property :
someObservableThatReturnsBoolean
.Subscribe(b => LoggedIn = b)
then the command behaves as expected.
I notice that this happens when there are multiple "instances" of a this.WhenAnyValue(...) pointing to the same ObservableAsPropertyHelper property.
Can you create a small sample that reproduces this issue?
Closed due to no response.