RelayCommand - MVVMLight 4.5 vs previous

Nov 16, 2013 at 12:22 AM
Edited Nov 16, 2013 at 12:25 AM
Before updating to MVVMLight 4.5 we would construct RelayCommands in our viewmodels with lambdas. Both execute and canexcute callbacks are fired when bound to a button. Specifially, this is in an .NET 4.5 WPF application.
new RelayCommand(() => Execute(), CanExecute)
However after updating to MVVMLight 4.5, in the example above CanExecute is invoked but () => Execute() does not get invoked.
Coordinator
Nov 16, 2013 at 12:37 AM
Hi,

Can you please send me a repro code at laurent (at) galasoft (dot) ch

Thanks
Laurent
Nov 19, 2013 at 11:10 AM
@tweak

Using .NET4.5 as well.

This works okay for me.
 this.commandAddSetting = new RelayCommand(
                                        () => AddNewSetting()
                                      , () => _screenMode == screenMode.UserSettingGrid);