title: In wpf how to access window.resources in usercontrol
body: <p>I have a child usercontrol and I am having trouble accessing its parent usercontrol's resources. The resource is a collectionViewSource and its source is set in the code behind of the parent usercontrol, the source is set to a query result from LINQ to SQL. Both usercontrols are defined in their own xaml file. I tried using DynamicResource and it complained saying it needs to be used with a DepenednecyProperty or so...</p>
  
  <p><strong>parent usercontrol</strong>:</p>
  
  <pre><code>...
  &lt;UserControl.Resources&gt;
      &lt;CollectionViewSource x:Key="UsageTypeSource"/&gt;
  &lt;/UserControl.Resources&gt;
  ...
  </code></pre>
  
  <p><strong>child usercontrol</strong>:</p>
  
  <pre><code>...
  &lt;ComboBox Height="28" HorizontalAlignment="Left" Margin="147,1,0,0" x:Name="cbxUsage"
            Grid.Column="1" Grid.Row="2" Width="186"
            SelectedItem="{Binding Path=UsageType, ValidatesOnExceptions=true, NotifyOnValidationError=true}"
            VerticalAlignment="Top" SelectedValuePath="ID"
            SelectedValue="{Binding Path=Usage}"
            ItemsSource="{Binding Source={StaticResource UsageTypeSource}}"
            DisplayMemberPath="Type"/&gt;
  ...
  </code></pre>
  
  <p>The error I am getting is 'The resource "UsageTypeSource" could not be resolved'</p>
  
  <p>Can you provide the proper way to access the resource</p>
  
  <p>Thanks in advance
  Ash</p>