Can't get action bubbeling to work!

Topics: Actions & Coroutines, Getting Started
Aug 1, 2013 at 4:26 PM
Im using Caliburn.Micro in a WP8 app and i have the following XAML:
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
    <ListBox x:Name="Items" HorizontalContentAlignment="Stretch">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Margin="10" toolkit:TiltEffect.IsTiltEnabled="True">
                    <TextBlock Text="{Binding Name}" />
                    <toolkit:ContextMenuService.ContextMenu>
                        <toolkit:ContextMenu>
                            <toolkit:MenuItem Header="Run" cal:Message.Attach="Run($dataContext)" />
                            <toolkit:MenuItem Header="Delete" cal:Message.Attach="Delete($dataContext)" />
                        </toolkit:ContextMenu>
                    </toolkit:ContextMenuService.ContextMenu>
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
</Grid>
And the following .net code
readonly ObservableCollection<TTask> items = new ObservableCollection<TTask>();

public ObservableCollection<TTask> Items
{
    get
    {
        return items;
    }
}

public void Run(TTask task)
{

}

public void Delete(TTask task)
{

}
Why do i get a exception when i select Run or Delete "No target found for method XXXX".

https://caliburnmicro.codeplex.com/wikipage?title=All%20About%20Actions
Has a example that is more or less identical..
Aug 1, 2013 at 9:32 PM
Edited Aug 1, 2013 at 9:32 PM
its a problem that is easily over come but is related to nesting and visual tree of wpf/Silverlight. To solve the problem you have to use abit of CM wizardry to overcome the problem:
<telp:RadContextMenu.ContextMenu>
     <telp:RadContextMenu x:Name="ScheduledFlightMenu"  cm:Action.TargetWithoutContext="{Binding DataContext, ElementName=ScheduledFlights}">
          <telp:RadContextMenuItem Content="edit" cm:Message.Attach="EditFlight($dataContext)" />
          <telp:RadContextMenuItem Content="delete" cm:Message.Attach="DeleteFlight($dataContext)" />
      </telp:RadContextMenu>
</telp:RadContextMenu.ContextMenu>  
cm:Action.TargetWithoutContext="{Binding DataContext, ElementName=ScheduledFlights}"

Bold part is the key to your nest issues...