title: DataContext ComboBox Binding inside of ListBox
body: <p>I have a <code>ListBox</code> that displays a <code>List&lt;Item&gt; Items</code> with Item being a custom object. Foreach item I want the user to see a <code>ComboBox</code> with <code>List&lt;string&gt; Options</code> as the Source with the selected Item tying back to a property on a Item .  In the list box I have no trouble binding the individual Item properties but how do I reach back up into the DataContext to get my list of options?</p>
  
  <p>View Model is being set as the page's DataContext</p>
  
  <pre><code>class ViewModel
  {
        public ObservableCollection&lt;string&gt; Options { get; set; }
        public ObservableCollection&lt;Item&gt; Items { get; set; }
  }
  </code></pre>
  
  <p>Xaml</p>
  
  <pre><code>&lt;ListBox x:Name="ItemsListBox" ItemsSource="{Binding Items}"&gt;
      &lt;ListBox.ItemTemplate&gt;
           &lt;DataTemplate&gt;
               &lt;Grid Height="50" &gt;
                   &lt;Grid.ColumnDefinitions&gt;
                       &lt;ColumnDefinition Width="*"/&gt;
                       &lt;ColumnDefinition Width="*"/&gt; 
                   &lt;/Grid.ColumnDefinitions&gt;
                   &lt;TextBlock x:Name="ItemProperty1TB" 
                       Text="{Binding Path=Property1, Mode=OneWay}"
                       Grid.Column="0" 
                   /&gt;
                   &lt;ComboBox x:Name="OptionsCB" 
                       SelectedItem ="{Binding ChosenOptions, Mode=TwoWay}" 
                       ItemsSource="{Binding Path=DataContext.Options}"          
                       Grid.Column="1" 
                       PlaceholderText="Option"
                   /&gt;
              &lt;/Grid&gt;
          &lt;/DataTemplate&gt;
      &lt;/ListBox.ItemTemplate&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>I tried to cut out as much extra code and get to a readable example.</p>
  
  <p><a href="https://stackoverflow.com/questions/30225600/how-to-bind-to-a-source-inside-a-listbox-different-from-the-itemssource-already">How to bind to a source inside a ListBox different from the ItemsSource already specified</a> This uses AncestorType that does not exist?</p>
  
  <p><a href="https://social.msdn.microsoft.com/Forums/vstudio/en-US/73130f47-05bd-4b5a-b8cc-acf598451c23/combobox-inside-listboxitemtemplate-binding-problem?forum=wpf" rel="nofollow noreferrer">ComboBox inside Listbox.ItemTemplate Binding problem</a> This binds to a static resource. Should I put my options into a static resource?</p>
  
  <p><code>ElementName</code> looks promising but my IDE only recommends Elements scoped to inside the ListBox... <strong>DO NOT TRUST VISUAL STUDIO</strong></p>
  
  <p>Am I just going about this all wrong?</p>