-
-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Description
I have the following code:
var canRemove = Observable
.Merge(SelectedCoordsItem.Select(x => x is not null))
.ObserveOnUIThreadDispatcher()
.Where(_ =>
{
if (SelectedCoordsItem.Value is null)
{
return false;
}
return _savedCoordinates.Contains(SelectedCoordsItem.Value);
});
AddNewItemCommand = new ReactiveCommand(AddNewItem).DisposeItWith(Disposable);
RemoveItemCommand = canRemove.ToReactiveCommand<Unit>(RemoveItem).DisposeItWith(Disposable);In this case when canRemove translates false value it doesn't turn off my command.
When I turn canRemove into ReactiveProperty everything works fine.
I guess that it is a bug.
If Observable is not a valid source for canExecute in this context, it would be helpful to either:
- restrict the API so that such usage produces a compile-time error, or
- add a remark in the XML documentation clarifying the limitation and the correct usage pattern.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels