Cannot find ButtonBaseExtensions.Command in SL4.dll

Jul 27, 2010 at 5:31 AM
Edited Jul 27, 2010 at 5:39 AM
Hello,

I solved my problem though, I'm curious what a better approach is. So please let me ask it.

I've just got the latest binaries for SL4, and tried to implement the RelayCommand as your sample http://blog.galasoft.ch/archive/2009/09/26/using-relaycommands-in-silverlight-and-wpf.aspx.

But, no luck, I couldn't compile because of the following xaml code,

<button cmd:ButtonBaseExtensions.Command={Binding SubmitCommand} Content="Submit" />

The error said something like "ButtonBaseExtensions doens't have a Command". Of course I included the namespace 'cmd', but it's weird since I searched for the ButtonBaseExtensions in both GalaSoft.MvvmLight.Extras.SL4.dll and GalaSoft.MvvmLight.SL4.dll by using the Reflector, there is no such a class or a property.

I've achieved what I wanted using EventToCommand, but I want to know where the ButtonBaseExtensions has gone.

Cheers.
yokyo

Oh, I must say before I leave, 'Thank you for such a great toolkit!!'
Coordinator
Jul 27, 2010 at 12:29 PM
Edited Jul 27, 2010 at 12:30 PM

Hi,

Thanks for the kind words.

The ButtonBase class in Silverlight 4 now has a Command and CommandParameter properties, and thus ButtonBaseExtension has been removed from the SL4 version of the Toolkit. You can use:

<Button Command={Binding SubmitCommand} Content="Submit" />

Cheers, Laurent

Jul 27, 2010 at 12:51 PM
Thank you for your reply, Laurent.

That's good news! Anyway, seems I need to dig into the SL4 much deeper :)

Cheers,
yokyo