Sunday, October 4, 2009

RelayCommand in Silverlight

It seems there are memory leak issues using Prism 2's DelegateCommand. I looked in the source for for Prism 3 recently and saw they appeared to be addressing them. One of the guys at work, doing some WPF stuff imported Josh Smith's RelayCommand, not because of memory leak issues though, but becuase he had found that Prism's DelegateCommand didn't behave as expected when the CanExecute property of the Command changed - he was having to do all the checks himself. RelayCommand does this for you.

I looked at using it in Silverlight, but found it was using the .NET 3.5 CommandManager which is not present in Silverlight. I just found this nice post by Laurent Bugnion that discusses this. Seems that's just the way it is in Silverlight. :-(

No comments:

Post a Comment