ObservableCommand for ElementName Binding (not just Command)

Topics: Prism v2 - Silverlight 2
Jan 19, 2009 at 4:06 PM
I have been using ObservableCommand instead of Command=ElementName=something, Path=MyCommand in Silverlight. And it's working fine.

Binding bindingBuy = new Binding("BuyCommand");


    bindingBuy.Source = this.DataContext;
    ((ObservableCommand)this.Resources["BuyCommand"]).SetBinding(ObservableCommand.ValueProperty, bindingBuy);

But I'm looking for the object binding (e.g.  IsEnabled = {Binding ElementName=something, Path=MyProperty})

I tried to create my own class "ObservableProperty" that inherited from ObservableObject and pass the string instead of ICommand. but It doesn't work. Did I do something wrong? How can I make the object-binding work?