title: Binding to the selected item in an ItemsControl
body: <p>I created a custom <code>ComboBox</code> as follows: (note, code is not correct but you should get the general idea.) The <code>ComboBox</code> contains 2 dependency properties which matter: <code>TitleText</code> and <code>DescriptionText</code>.</p>
  
  <pre><code>&lt;Grid&gt;
    &lt;TextBlock x:Name="Title"/&gt;
    &lt;Grid x:Name="CBG"&gt;
      &lt;ToggleButton/&gt;
      &lt;ContentPresenter/&gt;
      &lt;Popup/&gt;
    &lt;/Grid&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>I want to use this <code>ComboBox</code> to display a wide range of options. I created a class called Setting which inherits from <code>DependencyObject</code> to create usable items, I created a <code>DataTemplate</code> to bind the contents of this <code>Settings</code> object to my <code>ComboBox</code> and created a <code>UserControl</code> which contains an <code>ItemsControl</code> which has as a template my previously mentioned <code>DataTemplate</code>. I can fill it with <code>Setting</code> objects.</p>
  
  <pre><code>&lt;DataTemplate x:Key="myDataTemplate"&gt;
    &lt;ComboBox TitleText="{Binding Title}" DescriptionText="{Binding DescriptionText}"/&gt;
  &lt;/DataTemplate&gt;
  
  &lt;UserControl&gt;
    &lt;Grid&gt;
      &lt;StackPanel Grid.Column="0"&gt;
        &lt;ItemsControl Template="{StaticResource myDataTemplate}"&gt;
          &lt;Item&gt;
            &lt;Setting Title="Foo" Description="Bar"&gt;
              &lt;Option&gt;Yes&lt;/Option&gt;&lt;Option&gt;No&lt;/Option&gt;
            &lt;/Setting&gt;
          &lt;/Item&gt;
        &lt;/ItemsControl&gt;
      &lt;/StackPanel&gt;
      &lt;StackPanel Grid.Column="1"&gt;
        &lt;TextBlock x:Name="Description"/&gt;
      &lt;/StackPanel&gt;
    &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>I would like to have the <code>DescriptionText</code> of the selected <code>ComboBox</code> (selected by either the <code>IsFocus</code> of the <code>ComboBox</code> control or the <code>IsOpen</code> property of the popup) to be placed in the <code>Description</code> <code>TextBlock</code> in my <code>UserControl</code>.</p>
  
  <p>One way I managed to achieve this was replacing my <code>ItemsControl</code> by a <code>ListBox</code> but this caused several issues: it always showed a scrollbar even though I disabled it, it wouldn't catch focus when my popup was open but only when I explicitly selected the item in my <code>ListBox</code>, when I enabled the <code>OverridesDefaultStyle</code> property the contents of the <code>ListBox</code> wouldn't show up at all, I had to re-theme the <code>ListBox</code> control to match my <code>UserControl</code> layout...</p>
  
  <p>What's the best and easiest way to get my <code>DescriptionText</code> to show up without using a <code>ListBox</code> or creating a custom <code>Selector</code> control (as that had the same effect as a <code>ListBox</code>)?</p>
  
  <p>The goal at the end is to loop through all the items (maybe get them into an <code>ObservableCollection</code> or some sort and to save them into my settings file.</p>