ICommand.CanExecute() and NullReferenceException

by Christoph Menge in .NET

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 to Twitter Post to Delicious Post to Digg Post to Facebook

No related posts.

Tags: , , ,

← Previous

Next →

Leave a Comment