I'm using mvvm pattern, and have the next situation. For example exists a method:
void LockPressed(KeyEventArgs e)
{
// Code
}
And here I register it:
App.Messenger.Register("LockPressed", (Action<KeyEventArgs>)LockPressed);
Thath works fine. But If I need to modify method, for it to take two parameters:
void LockPressed(KeyEventArgs e, string name)
{
//Code
}
Logicaly resgister operation should look like:
App.Messenger.Register("LockPressed", (Action<KeyEventArgs,string>)LockPressed);
But no success. I got an error:
Error CS1503 Argument 2: cannot convert from 'System.Action' to 'System.Action'
Any ideas how can I workaround it?
This should work:
or more complex
or