title: DependencyProperty for ItemsSource
body: <p>I have a XAML like:</p>
  
  <pre><code>&lt;UserControl x:Class="Book.CustomControls.HeaderedComboBox"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               DataContext="{Binding RelativeSource={RelativeSource Self}}"
               Width="200" Height="50"&gt;
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="Auto"/&gt;
              &lt;RowDefinition/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;TextBlock Grid.Row="0" Margin="2,2" VerticalAlignment="Center" Text="{Binding Header}" FontWeight="{Binding HeaderFontWeight}"/&gt;
          &lt;ComboBox Grid.Row="1" Margin="2,2" VerticalAlignment="Center" ItemsSource="{Binding ItemsSource, UpdateSourceTrigger=PropertyChanged}"
                    SelectedItem="{Binding SelectedItem, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
      &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>The cs-file therefor is:</p>
  
  <pre><code>public partial class HeaderedComboBox : UserControl
  {
      public HeaderedComboBox()
      {
          this.InitializeComponent();
          this.HeaderFontWeight = FontWeights.Normal;
      }
  
      public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register("Header", typeof(string), typeof(HeaderedComboBox));
      public static readonly DependencyProperty HeaderFontWeightProperty = DependencyProperty.Register("HeaderFontWeight", typeof(FontWeight), typeof(HeaderedComboBox));
      public static readonly DependencyProperty ItemsSourceProperty = DependencyProperty.Register("ItemsSource", typeof(IEnumerable), typeof(HeaderedComboBox));
      public static readonly DependencyProperty SelectedItemProperty = DependencyProperty.Register("SelectedItem", typeof(object), typeof(HeaderedComboBox));
  
      public string Header
      {
          get { return (string)GetValue(HeaderProperty); }
          set { SetValue(HeaderProperty, value); }
      }
  
      public FontWeight HeaderFontWeight
      {
          get { return (FontWeight)GetValue(HeaderFontWeightProperty); }
          set { SetValue(HeaderFontWeightProperty, value); }
      }
  
      public IEnumerable ItemsSource
      {
          get { return (IEnumerable)GetValue(ItemsSourceProperty); }
          set { SetValue(ItemsSourceProperty, value); }
      }
  
      public object SelectedItem
      {
          get { return GetValue(SelectedItemProperty); }
          set { SetValue(SelectedItemProperty, value); }
      }
  }
  </code></pre>
  
  <p>I tried to use this UserControl in any Window with</p>
  
  <pre><code>&lt;customControls:HeaderedComboBox Header="Category" ItemsSource="{Binding Categories}"/&gt;
  </code></pre>
  
  <p>Categories is just an <code>ObservableCollection&lt;string&gt;</code>. </p>
  
  <p>Unfortunately I don't see any items in the ComboBox. At the moment I have no idea, what I'm doing wrong. Any ideas?</p>