MVVM Light RelayCommand Parameters

I believe this will work:

_projmenuItem_Edit = new RelayCommand<object>((txt)=>ProjEditNode(txt));

— EDIT —

You’ll need to define your RelayCommand with the type as well:

e.g.

public RelayCommand<string> myCommand { get; private set; }
myCommand = new RelayCommand<string>((s) => Test(s));

private void Test(string s)
{
    throw new NotImplementedException();
}

Leave a Comment

tech