Short Syntax Binding Issue

Topics: Actions & Coroutines
Jun 8, 2011 at 1:07 AM

I have a UserControl on which I have declared a custom event:

     public event EventHandler<MapClickedEventArgs> MapClickedEvent;

public class MapClickedEventArgs : RoutedEventArgs
    {
        ...
    }

In my model I have a handler defined:

 

     public void HandleMapClicked(MapClickedEventArgs e)
     {
	....
     }

When I tried to bind the handler to the UserControl in the view using the short syntax:

 

cal:Message.Attach="[Event MapClickedEvent] = [Action HandleMapClicked($eventArgs)]"

the handler was never called. However using the long syntax:

      <i:Interaction.Triggers>
        <i:EventTrigger EventName="MapClickedEvent">
          <cal:ActionMessage MethodName="HandleMapClicked">
            <cal:Parameter Value="$eventArgs" />
          </cal:ActionMessage>
        </i:EventTrigger>
      </i:Interaction.Triggers>

 

works just fine. Anybody got any ideas why the short syntax would not work when the long syntax did?

 

 

Coordinator
Jun 8, 2011 at 4:33 PM

That's very strange. Can you create a simple solution that reproduces the issue, create a ticket for me and attach it? That should work...