ICommand.CanExecute() and NullReferenceException

April 10, 2008 – 6:12 pm

Have you ever tried to call ICommand.CanExecute()? It actually works fine, but only if you are not as naive as I am… Simply calling it without the proper know-how might result in a NullReferenceException, so what you should read is how to implement ICommandSource. See

MSDN: How To: Implement ICommandSource

MSDN: Implement ICommandSource Sample
.

Not a big thing, but since google didn’t show anything for “ICommand.CanExecute NullReferenceException”, it might help somebody I hope…

Post a Comment