Hi gang,
I know it's weird to mail the WPF list with a Silverlight question, but I know you guys have a lot of passion about this and I believe have already done a couple of implementations of concrete ICommand subclasses.
Josh: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
Laurent: http://www.galasoft.ch/mvvm/sample1/, http://blog.galasoft.ch/archive/2009/09/26/using-relaycommands-in-silverlight-and-wpf.aspx
Now, I'm NOT looking to start a religious war here. :) But the question came up internally and I wanted some feedback. If I were to include an ICommand subclass in the Silverlight Toolkit, I would probably end up with something very much like what Josh calls RelayCommand in his post above. In case you don't know me: I like simple and I dislike dependencies.
Do folks think that level of support is enough to start with, or are there additional ideas in Laurent's post - or anyone else's - that you think would need to be included? Are there special constructor forms you'd really want to see? Helper methods you "just can't live without"? That kind of stuff.
I can't promise I'll be able to do any of this, but I knew if I asked here, I'd probably get some great feedback.
Thanks in advance!
Hey David,
My RelayCommand is based on Josh's one, and almost not modified. I only fixed a bug in the Silverlight version of it, and reported the bug to Josh as well, so it might be fixed there too (it had to do with the initial query of the CanExecute method, so that a bound control would be disabled from the start if CanExecute returns false).
Regarding external dependencies, I hear you. Feel free to use my code in any way you want. In fact for some time I wanted to use the WTFPL license (but eventually I used the MIT one ;)
Cheers,
Laurent
P&p ships delegate command in Prism. Might be good to consolidate.
Glenn
--
Sent from my mobile device
Thanks again for all the fantastic feedback!