title: Binding to custom Dependency Property fails
body: <p>As the <code>SelectedItems property</code> of the ListBox control is a normal property and <strong>not</strong> a dependency property to bind to, I have derived of the ListBox and created a new dependency property <code>SelectedItemsEx</code>.</p>
  
  <p>But my XAML compiler keeps giving me the error </p>
  
  <blockquote>
    <p>A 'Binding' cannot be set on the 'SelectedItemsEx' property of the
    type 'MyListBox'. A 'Binding' can only be set on a DependencyProperty
    of a DependencyObject.</p>
  </blockquote>
  
  <p>Why my property is not recognized as a dependency property? Any help is appreciated, thank you!</p>
  
  <p>XAML:</p>
  
  <pre><code>  &lt;MyListBox ItemsSource="{Binding MyData}" SelectedItemsEx="{Binding SelectedEx}" 
                                              SelectionMode="Extended"&gt; ... &lt;/MyListBox&gt;
  </code></pre>
  
  <p>ListBox' implementation:</p>
  
  <pre><code>public class MyListBox : ListBox
  {
      public readonly DependencyProperty SelectedItemsExProperty =
              DependencyProperty.Register("SelectedItemsEx", 
                  typeof(ObservableCollection&lt;MyItemsDataType&gt;), 
                  typeof(MyListBox), 
                  new PropertyMetadata(default(ObservableCollection&lt;MyItemsDataType&gt;)));
  
  
      public ObservableCollection&lt;MyItemsDataType&gt; SelectedItemsEx
      {
          get
          {
              var v = GetValue(SelectedItemsExProperty);
              return (ObservableCollection&lt;MyItemsDataType&gt;)v;
          }
          set { SetValue(SelectedItemsExProperty, value); }
      }
  
      protected override void OnSelectionChanged(SelectionChangedEventArgs e)
      {
          base.OnSelectionChanged(e);
          if (SelectedItemsEx != null)
          {
              SelectedItemsEx.Clear();
              foreach (var item in base.SelectedItems)
              {
                  SelectedItemsEx.Add((MyItemsDataType)item);
              }
          }
      }
  </code></pre>