//This is command defining
private ICommand myCommand;
public ICommand MyCommand
{
get
{
if (myCommand== null)
myCommand= new RelayCommand(MyMethod);
return myCommand;
}
set { myCommand= value; }
}
//This is your command method
public void MyMethod()
{
}
//This is your xaml
<Button Command="{Binding MyCommand}"/>
If you need parameter for pass to method;
myCommand= new RelayCommand<object>(MyMethod);//Change here like this;
And Change the XAML like this
//You can pass string parameter
<Button Command="{Binding MyCommand}" CommandParameter="MyParameter"/>
Or
//You can pass a property
<Button Command="{Binding MyCommand}" CommandParameter="{Binding MyProperty}"/>