WPF PRISM DelegateCommand Wrappers in .NET 4.5

November 27, 2012

If you happened to implement an ‘ICommand’ for your presentation logic in WPF, and decided to contain PRISM’s DelegateCommand within your class and use its own mechanism of the ‘CanExecuteChanged’ event – Beware! Consider the following example - class CommandWrapper : ICommand { private readonly DelegateCommand _command; public CommandWrapper(Action execute, Func<bool> canExecute) { _command = new DelegateCommand(execute, canExecute); } public bool CanExecute(object parameter) { return _command.CanExecute(parameter); ...
tags: ,


November 25, 2012

Yes, I am aware I didn’t post anything for a long time, sorry about that. I can try and excuse myself by saying that I had plenty on my hands, including bringing my house together, raising a new baby girl, and much more.. but I won’t Putting everything aside, I plan to get right back on the horse and start posting some interesting stuff real soon, so stay tuned!