title: Caliburn Micro not finding DataContext in ContextMenu within ListView
body: <p>I have populated a ListView with objects and I have bound a ContextMenu to those items in my ListView. The ContextMenu can only be opened by clicking on an item. The problem is that Caliburn Micro throws an error that it can't find a target method for ShowProperties(). </p>
  
  <p>I think this problem occurs because Caliburn doesn't have the correct DataContext of the ViewModel available. I've tried many solutions on Stackoverflow to make the ViewModel available to the ContextMenu item but to no avail e.g.:</p>
  
  <p><a href="https://stackoverflow.com/questions/3583507/wpf-binding-a-contextmenu-to-an-mvvm-command/25647539#25647539">WPF: Binding a ContextMenu to an MVVM Command</a></p>
  
  <p><a href="https://stackoverflow.com/questions/13587368/no-target-found-for-method-thrown-by-caliburn-message-attach?lq=1">“No target found for method” thrown by Caliburn Message.Attach()</a></p>
  
  <p><a href="https://stackoverflow.com/questions/10126797/wpf-context-menus-in-caliburn-micro">WPF Context Menus in Caliburn Micro</a></p>
  
  <p>This is the XAML code of my view:</p>
  
  <pre><code>&lt;Window x:Class="CueMaster.Views.AppView"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:dragDrop="clr-namespace:GongSolutions.Wpf.DragDrop;assembly=GongSolutions.Wpf.DragDrop"
           xmlns:cal="http://www.caliburnproject.org"
           Height="500" Width="800"&gt;
  &lt;Grid&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="*" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="200" /&gt;
          &lt;ColumnDefinition Width="*" /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
  
      &lt;ListView Grid.Column="1" Margin="5"
          ItemsSource="{Binding Cues}" 
          dragDrop:DragDrop.IsDragSource="True" 
          dragDrop:DragDrop.IsDropTarget="True"
          dragDrop:DragDrop.DropHandler="{Binding}"&gt;
  
          &lt;ListView.Resources&gt;
              &lt;ContextMenu x:Key="ItemContextMenu"&gt;
                  &lt;MenuItem Header="Properties" cal:Message.Attach="ShowProperties($dataContext)" Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListView}}"&gt;
                      &lt;MenuItem.Icon&gt;
                          &lt;Image Source="../PropertyIcon.png" /&gt;
                      &lt;/MenuItem.Icon&gt;
                  &lt;/MenuItem&gt;
              &lt;/ContextMenu&gt;
          &lt;/ListView.Resources&gt;
  
          &lt;ListView.ItemContainerStyle&gt;
              &lt;Style TargetType="{x:Type ListViewItem}" &gt;
                  &lt;Setter Property="ContextMenu" Value="{StaticResource ItemContextMenu}" /&gt;
              &lt;/Style&gt;
          &lt;/ListView.ItemContainerStyle&gt;
  
          &lt;ListView.View&gt;
              &lt;GridView &gt;
                  &lt;GridViewColumn Width="70" Header="Cue"  DisplayMemberBinding="{Binding Id}" /&gt;
                  &lt;GridViewColumn Width="100" Header="Name"  DisplayMemberBinding="{Binding Name}" /&gt;
                  &lt;GridViewColumn Width="100" Header="Description"  DisplayMemberBinding="{Binding Description}" /&gt;
                  &lt;GridViewColumn Width="70" Header="Duration"  DisplayMemberBinding="{Binding Duration}" /&gt;
                  &lt;GridViewColumn Width="70" Header="Elapsed"  DisplayMemberBinding="{Binding Elapsed}" /&gt;
                  &lt;GridViewColumn Width="70" Header="Remaining"  DisplayMemberBinding="{Binding Remaining}" /&gt;
              &lt;/GridView&gt;
          &lt;/ListView.View&gt;
      &lt;/ListView&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>What did I miss?</p>