title: What is the easiest way to share resources between UserControls in a WPF User Control library?
body: <p>There are a WPF User Control library and two (or more) User Controls in it. I need to use the same style in both user controls. How can I share this style?
  For example:</p>
  
  <p>This is the style:</p>
  
  <pre><code>&lt;Style x:Key="customLabelStyle" TargetType="Label"&gt;
      ...
  &lt;/Style&gt;
  </code></pre>
  
  <p>User control A:</p>
  
  <pre><code>&lt;UserControl x:Class="Edu.Wpf.Example.UserControlA"
     ...xmlns stuff... &gt;
     &lt;Grid&gt;
        ... some xaml markup...
        &lt;Label Style="{StaticResource customLabelStyle}"/&gt;
     &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>UserControl B:</p>
  
  <pre><code> &lt;UserControl x:Class="Edu.Wpf.Example.UserControlB"
     ...xmlns stuff... &gt;
     &lt;Grid&gt;
        ... some another xaml markup...
        &lt;Label Style="{StaticResource customLabelStyle}"/&gt;
     &lt;/Grid&gt;
  &lt;/UserControl&gt;
  </code></pre>
  
  <p>So how can I share this style between user controls in the library without involving of the application app.xaml resource dictionary?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I can add Themes\Generic.xaml into my library and define the style there. But in this case I have to use ComponentResourceKey as the key of the style. Right? It's long and not very handy expression...</p>