title: How to correctly bind to an Itemsource inside an datatemplate
body: <p>I am using an <code>ItemsControl</code> which has a list of Objects... inside the <code>ItemContainerTemplate</code> I have another <code>DataTemplate</code>. Inside of that <code>DataTemplate</code> I can't bind to the <code>ItemsControl.ItemSource</code> anymore.</p>
  
  <p>Since I am not very good with bindings via <code>Find Ancestor</code> and <code>RelativeSource</code> etc. I tried everything without even knowing how to properly use them...</p>
  
  <pre><code>&lt;ItemsControl ItemsSource="{Binding NoteList}"&gt;
    &lt;ItemsControl.ItemTemplate&gt;
      &lt;ItemContainerTemplate&gt;
        &lt;GroupBox Header="{Binding Title}"
                  Name="MyNoteList"
                  Style="{DynamicResource MaterialDesignCardGroupBox}"
                  Margin="16"&gt;
          &lt;GroupBox.HeaderTemplate&gt;
            &lt;DataTemplate&gt;
              &lt;DockPanel&gt;
                &lt;TextBlock Margin="8,0,0,0"
                           VerticalAlignment="Center"
                           Style="{StaticResource MaterialDesignSubheadingTextBlock}"
                           Text="{Binding}" /&gt;
                &lt;Button Padding="5"
                        Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
                        CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ItemsControl}}, Path=DataContext.NoteId}"
                        HorizontalAlignment="Right"
                        Background="Transparent"
                        BorderBrush="Transparent"&gt;
                  &lt;materialDesign:PackIcon Kind="Delete"
                                           Height="25"
                                           Width="25"
                                           VerticalAlignment="Center" /&gt;
                &lt;/Button&gt;
              &lt;/DockPanel&gt;
            &lt;/DataTemplate&gt;
          &lt;/GroupBox.HeaderTemplate&gt;
        &lt;/GroupBox&gt;
      &lt;/ItemContainerTemplate&gt;
    &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>I like to mention, that I want to bind to an object from <code>NoteList</code> with the name <code>NoteId</code> inside the <code>CommandParameter</code>. But I keep getting "null" from it. The binding inside my ViewModel is definitely correct. So i only need to know, how to access the <code>NoteId</code> Property from my <code>NoteList</code></p>