I need some quick help which is a road blocker for me now. I have Button in ItemsControl and I need to perform some task on Button click. I tried addin
If your ViewModel has a property of type ICommand you can bind the Button's Command property to that:
XAML:
C#:
public sealed class FooViewModel
{
public ICommand DoBarCommand
{
get;
private set;
}
//...
public FooViewModel()
{
this.DoBarCommand = new DelegateCommand(this.CanDoBar, this.DoBar);
}
}