title: C# WPF Binding path not working
body: <p>I currently have a ListBox that is bound to a collection of objects and displays a button for each object in the collection.</p>
  
  <p><strong>XAML:</strong></p>
  
  <pre><code>&lt;Window.DataContext&gt;
      &lt;local:MainWindowViewModel/&gt;
  &lt;/Window.DataContext&gt;
  
      &lt;ListBox x:Name="company_buttons"
               HorizontalContentAlignment="Left" VerticalContentAlignment="Top" 
               Padding="-2,-2,0,0" Height="280" Width="300" Background="{x:Null}" BorderBrush="{x:Null}" Margin="0,0,0,0" BorderThickness="0" 
               ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
               ItemsSource="{Binding Buttons_Binding}"&gt;
  
          &lt;ListBox.ItemTemplate&gt;
              &lt;DataTemplate&gt;
                  &lt;StackPanel&gt;
  
                      &lt;Button Background="#FFFCC515" Style="{StaticResource RoundCorner}" FontFamily="Segoe UI" FontSize="16" FontWeight="Bold" TabIndex="0" 
                                  CommandParameter="{Binding This_Works}"
                                  Command="{Binding HELP WITH THIS}"&gt;
                          &lt;StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Width="270" Height="44"&gt;
                              &lt;Label HorizontalContentAlignment="Center" VerticalContentAlignment="Top" Margin="5,0,5,0" Height="21" Padding="0" Content="{Binding This_Works}"/&gt;
                              &lt;Label HorizontalContentAlignment="Center" VerticalContentAlignment="Top" Margin="5,0,5,0" Height="21" Padding="0" Content="{Binding This_Works}"/&gt;
                          &lt;/StackPanel&gt;
                      &lt;/Button&gt;
  
                      &lt;Label VerticalContentAlignment="Top" Margin="5,0,5,0" Height="19" Padding="0" Foreground="White" FontFamily="Segoe UI" FontSize="12" FontWeight="Bold" Content="{Binding Path}"/&gt;
  
                  &lt;/StackPanel&gt;
              &lt;/DataTemplate&gt;
          &lt;/ListBox.ItemTemplate&gt;
  
      &lt;/ListBox&gt;
  </code></pre>
  
  <p>Here are the things that are used in the bindings:</p>
  
  <pre><code>public class ButtonContent : INotifyPropertyChanged
  {
   // stuff
  }
  
  public class MainWindowViewModel
  {
      public static ObservableCollection&lt;ButtonContent&gt; Buttons_Binding
      {
   // stuff
      }
  
      public ICommand Command
      {
   // stuff
      }
  </code></pre>
  
  <p>My problem is I do not know how to bind the button click to <code>Command</code> since it is outside of the collection <code>Buttons_Binding</code> and hence not in the same data context. All the stuff I have seen from examples and what I have tried have all failed.</p>