-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Describe the bug
If I use BindCommand
to bind a view model command to a button declared in XAML like this:
this.BindCommand(ViewModel, vm => vm.DecreaseSpeed, view => view.DecreaseSpeed);
I will then get a warning in the log like this:
POCOObservableForProperty: The class ...PreviewView property DecreaseSpeed is a POCO type and won't send change notifications, WhenAny will only return a single value!
The warning is wrong since the button DecreaseSpeed
is not a property on the view but a field, declared like this in XAML:
<RepeatButton Name="DecreaseSpeed" Content="Decrease"/>
Steps To Reproduce
- Create a view model with single command property
- Create a corresponding view to the view model and implement IViewFor
- Declare a named button in view XAML
- Add call to BindCommand in view constructor to bind the view model command to the button
- When the view model is assigned to the view the BindCommand will execute and the warning will appear in the log
I'm working on a test case to show this.
Expected behavior
I expect not to see any warnings in the log when doing something expected by the library, like binding a command to a button declared in XAML.
Environment
- OS: Windows 10
- Version: 9.12.0 to 9.15.4
- Device: PC
Additional context
I have chatted with @glennawatson on slack about this issue https://reactivex.slack.com/archives/C02AJB872/p1558086054213400