title: How to data-bind to a property of a composite object in a collection?
body: <p>I need to allow selection of several items from this predefined list:</p>
  
  <pre><code>public enum QuarkType{
      Up,
      Down,
      [Description("Magical Being")] Charm,
      [Description("Quite Odd")] Strange,
      Top,
      Bottom
  }
  </code></pre>
  
  <p>So I use <a href="https://wpftoolkit.codeplex.com/wikipage?title=CheckComboBox&amp;referringTitle=Home" rel="nofollow">CheckComboBox</a>, and use the <code>DescriptionAttribute</code> where I need to use custom description. I feed the <code>CheckComboBox</code> using a <code>MarkupExtension</code> that returns a list of all values of the given <code>enum</code> as <code>IEnumerable&lt;EnumDescriptionPair&gt;</code>, where <code>EnumDescriptionPair</code> is:</p>
  
  <pre><code>public class EnumDescriptionPair{
      public object Value { get; set; }
      public string Description { get; set; }
  }
  </code></pre>
  
  <p>Now the problem is how to pass the <code>Value</code>s of this list to the code-behind list:</p>
  
  <pre><code>public ObservableCollection&lt;QuarkType&gt; SelectedQuarksList { get; set; }
  </code></pre>
  
  <p>I mean, how to take just the <code>Value</code> out of the <code>EnumDescriptionPair</code> for each item of the selected list ?</p>
  
  <p>This is what I have thus far. It obviously doesn't work (meaning it shows the right strings in the <code>CheckComboBox</code>, and allows selecting several items, but isn't reflected in the <code>SelectedQuarksList</code> mentioned above):</p>
  
  <pre><code>&lt;Window x:Class="MyEditor.MainWindow"
          xmlns:loc="clr-namespace:MyEditor"
          xmlns:toolKit="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
          DataContext="{Binding RelativeSource={RelativeSource Self}}"&gt;
  
      &lt;StackPanel&gt;
          &lt;toolKit:CheckComboBox x:Name="Ccb" Delimiter=","
                                 ItemsSource="{loc:EnumItemsValueConverter {x:Type loc:QuarkType}}"
                                 DisplayMemberPath="Description"
                                 SelectedItemsOverride="{Binding SelectedQuarksList}" /&gt;
  
          &lt;ListBox ItemsSource="{Binding SelectedQuarksList}" /&gt;
      &lt;/StackPanel&gt;
  &lt;/Window&gt;
  </code></pre>