Parsing bug in ActionMessage?

Mar 30, 2011 at 5:15 PM

Hello all,

I have a code which used to work with a previous version of CM, which doesn't now.

I have this XAML in a view:

<Path Stretch="Fill" Stroke="Blue" StrokeThickness="2" Fill="Transparent" x:Name="Background" Micro:Message.Attach="[Event MouseDown] = [Action FieldMouseDown($eventArgs, $source)">

The view-model has the following method:

public IEnumerable<IResult> FieldMouseDown(MouseButtonEventArgs args, FrameworkElement source)
    //Do some stuff

I have the following exception: No target found for method Event MouseDown = Action FieldMouseDown

Effectively, in ActionMessage.GetTargetMethod, the MethodName property of message is : Event MouseDown = Action FieldMouseDown whereas it should only be FieldMouseDown.

Is this a known bug?

Thanks in advance


Mar 30, 2011 at 6:26 PM

You should add the ] at the end of your Message.Attach and see if that fixes it.

Mar 30, 2011 at 8:01 PM

Oh thanks, I didn't even notice that. I must have failed a copy / paste :/

Mar 30, 2011 at 8:14 PM

Did that fix the problem?

Mar 30, 2011 at 8:14 PM

Yes it did :)

Mar 30, 2011 at 11:26 PM

I suppose this is expected, given the stricter rule used to identify the long syntax (i.e. regex check).