Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Passing multiple parameters RelayCommand? [duplicate]

Tags:

wpf

mvvm-light

Possible Duplicate:
Passing two command parameters using a WPF binding

I need that send two parameters to my RelayCommand like:

public RelayCommand<String,Int> MyCommand {get;set;} Or
public RelayCommand<EventArgument,String> MyCommand {get;set;}
like image 444
M.Azad Avatar asked Nov 30 '22 15:11

M.Azad


1 Answers

Wrap them in an object:

public RelayCommand<MyModel> MyCommand { get; set; }

where MyModel will contain the two properties:

public class MyModel
{
    public int Id { get; set; }
    public string Name { get; set; }
}
like image 174
Darin Dimitrov Avatar answered Dec 21 '22 03:12

Darin Dimitrov