You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a WPF project, and I want to monitor a property through the ObservesProperty method of a DelegateCommand, and trigger DelegateCommandBase.RaiseCanExecuteChanged by a change in the property. Unfortunately, no matter what I try, it doesn't work.
create 2 windows and 2 Viewmodels, Binding command;
Viewmodel inherits BindableBase.
Create the corresponding DelegateCommand in the ViewModel, specify its executeMethod and canExecuteMethod during initialization, and ObservesProperty() to monitor the properties.
is monitored by the value of the property changes to trigger RaisePropertyChanged();.
the canExecuteMethod is not re-executed.
Platform with bug
WPF
Affected platforms
Windows
Did you find any workaround?
no
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
You have some big problems in your code, but that's not what's causing this specific issue. ObservesProperty only works with public properties. This means it will not work with a private variable.
This is your issue -> private StartViewModel _startViewModel;
Change that to a public property and it will work as expected.
Description
I have a WPF project, and I want to monitor a property through the ObservesProperty method of a DelegateCommand, and trigger DelegateCommandBase.RaiseCanExecuteChanged by a change in the property. Unfortunately, no matter what I try, it doesn't work.
Here is a link to the repo - https://github.com/ColoCoffee/PrismTest.git
Steps to Reproduce
Platform with bug
WPF
Affected platforms
Windows
Did you find any workaround?
no
Relevant log output
No response
The text was updated successfully, but these errors were encountered: