Passer des paramètres à MVVM Commande

Personne ne sait comment passer des paramètres à Command à l'aide de CommandHandler? Supposons que je voudrais faire passer la chaîne de valeur codée en dur à partir de XAML. Je sais comment passer de XAML, mais pas comment le gérer dans MVVM code derrière. Le code ci-dessous fonctionne très bien si il n'est pas nécessaire de passer des paramètres.

public ICommand AttachmentChecked
{
    get
    {
        return _attachmentChecked ?? (_attachmentChecked = new CommandHandler(() => ExecuteAttachmentChecked(), CanExecuteAttachmentChecked()));
    }
}

private void ExecuteAttachmentChecked()
{        
}

private bool CanExecuteAttachmentChecked()
{
    return true;
}

CommandHandler:

public class CommandHandler : ICommand
{
    private Action _action;
    private bool _canExecute;

    public CommandHandler(Action action, bool canExecute)
    {
        _action = action;
        _canExecute = canExecute;
    }

    public bool CanExecute(object parameter)
    {
        return _canExecute;
    }

    public event EventHandler CanExecuteChanged;

    public void Execute(object parameter)
    {
        _action();
    }
}

OriginalL'auteur lucas | 2016-02-12