Message Action with array parameters

Jul 10, 2011 at 12:37 PM


Is there a way to pass an array as Message.Action parameters?
I've a method in the viewmodel wich has an array as parameter like this

Keys(params string[] keys)

and in the xaml I've this

<Button x:Name="Number00" cal:Message.Attach="Keys('D0','D0')" etc../>

when I click that button an exception is raised because the ActionMessage GetTargetMethod function looks for a methods named Keys but with 2 parameters.
I tried to replace the original GetTargetMethod function with this

(from method in target.GetType().GetMethods()
							where method.Name == message.MethodName
							let methodParameters = method.GetParameters()
							where message.Parameters.Count == methodParameters.Length ||
							(methodParameters.Length == 1 && methodParameters[0].ParameterType.IsArray)
							select method).FirstOrDefault();

with this func the method is found but the parameter passed to the methods is always null...

Jul 10, 2011 at 4:49 PM

We don't support that. The message parser is fairly dumb for simplicity's sake. We don't support proper overload resolution for that matter either.