title: XAML MenuFlyoutItem Command Binding in ListView
body: <p>I am using MVVM light in the project, and I have a ListView in the NoteListPage. In the ListView, I define 2 MenuFlyoutItem, I want to bind each one the command I have created in my View Model.</p>
  
  <p>Here is some detail in my NoteListPage.xaml:</p>
  
  <pre><code>DataContext="{Binding NoteListPage, Source={StaticResource Locator}}"&gt;
  </code></pre>
  
  <p>In my View Model, I have: </p>
  
  <pre><code>    public ObservableCollection&lt;Note&gt; NoteList
      {
          get { return _noteList; }
  
          set { Set(() =&gt; NoteList, ref _noteList, value); }
      }
  
      public ICommand DeleteComamand { get; private set; }
      public ICommand EditCommand { get; private set; }
  </code></pre>
  
  <p>I bind the ItemSource to NoteList, </p>
  
  <pre><code>&lt;ListView  x:Name="NoteListView" ItemsSource="{Binding NoteList}"&gt;
          &lt;ListView.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;Border 
                      BorderBrush="White"
                      BorderThickness="2"
                      CornerRadius="5"
                      Width="360"
                      Margin="10,5" 
                      Tapped="Border_Tapped"&gt;
  
                      &lt;FlyoutBase.AttachedFlyout&gt;
                          &lt;MenuFlyout&gt;
                              &lt;MenuFlyoutItem Text="Delete"
                          /&gt;
  
                              &lt;MenuFlyoutItem Text="Edit"
                           /&gt;
                          &lt;/MenuFlyout&gt;
                      &lt;/FlyoutBase.AttachedFlyout&gt;
  
                      &lt;StackPanel &gt;
                          &lt;TextBlock
                                 FontSize="30" Text="{Binding NoteTitle}"/&gt;
                          &lt;TextBlock
                                 FontSize="25"
                                 TextWrapping="Wrap" Text="{Binding NoteContent}"/&gt;
                      &lt;/StackPanel&gt;
  
                  &lt;/Border&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListView.ItemTemplate&gt;
      &lt;/ListView&gt;
  </code></pre>
  
  <p>but then I can't bind the MenuFlyoutItem command, because the data context is of type Model.Note</p>
  
  <p><img src="https://i.stack.imgur.com/ep2el.png" alt="enter image description here"></p>
  
  <p>How can I bind DeleteComamand and EditCommand to MenuFlyoutItem, but ListView ItemSource is still bound to NoteList in this case? Otherwise the list view page doesn't show any item title/content.</p>