title: Binding to a dependency property of a user control WPF/XAML
body: <p>My app looks like this:</p>
  
  <hr>
  
  <p><code>SectionHeader</code></p>
  
  <p><code>SectionHeader</code></p>
  
  <p><em>Content</em></p>
  
  <p><code>SectionHeader</code></p>
  
  <p><em>Content</em></p>
  
  <hr>
  
  <p><code>SectionHeader</code> is a user control with two dependency properties = Title and Apps.</p>
  
  <p>Title does not change but Apps needs to be bound to the main window view model Apps property. The Apps property is only required for two of the three section headers.</p>
  
  <pre><code>&lt;c:SectionHeader DockPanel.Dock="Top" x:Name="SectionResources" Title="RESOURCES"
     Apps="{Binding Path=Apps}" /&gt;
  </code></pre>
  
  <p>This is how it is at the moment. The problem is that the Apps don't show up.</p>
  
  <p>In <code>SectionHeader</code> the DataContext is set to itself as follows which allows the Title to show up.</p>
  
  <pre><code>DataContext="{Binding RelativeSource={RelativeSource Self}}"
  </code></pre>
  
  <p>Apps is the ItemsSource for a <code>ItemsControl</code> in the UserControl:</p>
  
  <pre><code>&lt;ItemsControl
        ItemsSource="{Binding Apps}"&gt;
  </code></pre>
  
  <hr>
  
  <p>So my questions are:</p>
  
  <ul>
  <li>How can I data bind to a UserControl DP?</li>
  <li>Is their an easier way of doing this layout without UserControls?</li>
  </ul>
  
  <p>EDIT:</p>
  
  <p>Forgot to mention that Apps is an ObservableCollection of AppsItems.</p>
  
  <p>This is what my DP looks like:</p>
  
  <pre><code>public static readonly DependencyProperty AppsProperty = DependencyProperty.Register("Apps",
    typeof (ObservableCollection&lt;AppsItem&gt;), typeof (SectionHeader),
    new PropertyMetadata(null, OnAppsPropertyChanged));
  
  private static void OnAppsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  {
    Console.WriteLine("Hello!!!");
    var sectionHeader = d as SectionHeader;
    var value = e.NewValue as ObservableCollection&lt;AppsItem&gt;;
    sectionHeader.Apps = value;
  }
  </code></pre>