We're using a RelayCommand<T> with both an execute and canExecute delegate in our view model.
In XAML, we bind Button.Command to the command and Button.CommandParameter to the selected item of ListBox.
In version 4, whenever the user changes the SelectedItem of the ListBox, the RelayCommand<T>.CanExecute is re-evaluated with the new command parameter value.
After upgrading to version 5, the RelayCommand<T>.CanExecute is never evaluated. Not when the Window is loaded (because the command parameter is null at that moment), but also not when an item is selected in the list box.
Please fix!
Thanks,
Joost
Comments: Hi, Check the release notes here: http://www.mvvmlight.net/installing/changes The "Important note about issue 7659" is what you are looking for. I am working on a blog post to explain this more in details. Doing the following solves the issue: * Upgrade to MVVM Light Libs only V5.0.2 * Replace the GalaSoft.MvvmLight.Command namespace with GalaSoft.MvvmLight.CommandWpf There is more technical detail about this issue here: https://mvvmlight.codeplex.com/workitem/7659 Cheers Laurent
In XAML, we bind Button.Command to the command and Button.CommandParameter to the selected item of ListBox.
In version 4, whenever the user changes the SelectedItem of the ListBox, the RelayCommand<T>.CanExecute is re-evaluated with the new command parameter value.
After upgrading to version 5, the RelayCommand<T>.CanExecute is never evaluated. Not when the Window is loaded (because the command parameter is null at that moment), but also not when an item is selected in the list box.
Please fix!
Thanks,
Joost
Comments: Hi, Check the release notes here: http://www.mvvmlight.net/installing/changes The "Important note about issue 7659" is what you are looking for. I am working on a blog post to explain this more in details. Doing the following solves the issue: * Upgrade to MVVM Light Libs only V5.0.2 * Replace the GalaSoft.MvvmLight.Command namespace with GalaSoft.MvvmLight.CommandWpf There is more technical detail about this issue here: https://mvvmlight.codeplex.com/workitem/7659 Cheers Laurent