title: Share certain resources among TreeViewItem.Resources
body: <p>I have several TreeView controls in my application, and they are all similar to this:  </p>
  
  <pre><code>&lt;TreeView SelectedItemChanged="TreeView_OnSelectedItemChanged" x:Name="AccountsTree" &gt;
      &lt;TreeView.Resources&gt;
          &lt;!-- styles --&gt;
      &lt;/TreeView.Resources&gt;
      &lt;TreeViewItem Header="Things" &gt;
          &lt;TreeViewItem.Resources&gt;
  
              &lt;!--From: https://stackoverflow.com/a/17814749/107037--&gt;
              &lt;SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="LightBlue" /&gt;
              &lt;!--&lt;SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" /&gt;--&gt;
              &lt;SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" /&gt;
              &lt;!--&lt;SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="Black" /&gt;--&gt;
  
              &lt;HierarchicalDataTemplate DataType="{x:Type local:ThingEntity}" ItemsSource="{Binding Children, Mode=OneWay}"&gt;
                  &lt;HierarchicalDataTemplate.Resources&gt;
                      &lt;!-- styles --&gt;
                  &lt;/HierarchicalDataTemplate.Resources&gt;
                  &lt;StackPanel Orientation="Horizontal"&gt;
                      &lt;i:Interaction.Behaviors&gt;
                          &lt;!-- drag 'n drop --&gt;
                      &lt;/i:Interaction.Behaviors&gt;
                      &lt;Image x:Name="ThingIcon" /&gt;
                      &lt;TextBlock Text="{Binding ThingName}" Margin="6,0,6,0" /&gt;
                  &lt;/StackPanel&gt;
              &lt;/HierarchicalDataTemplate&gt;
          &lt;/TreeViewItem.Resources&gt;
      &lt;/TreeViewItem&gt;
  &lt;/TreeView&gt;
  </code></pre>
  
  <p>I found the simple way to change the SelectedItem color in this answer: <a href="https://stackoverflow.com/a/17814749/107037">TreeView shows blue for selected item</a></p>
  
  <p>Is there a way to somehow encapsulate the collection of SolidColorBrush definitions to make them easy to re-use in all the TreeViews that need them?</p>
  
  <p>Alternatively, is there a way to apply that collection of Brushes to all TreeViewItem controls, much like</p>
  
  <pre><code>&lt;Style TargetType="{x:Type TreeViewItem}"&gt;  
      &lt;!-- style stuff --&gt;  
  &lt;/Style&gt;  
  </code></pre>
  
  <p>Applies the defined Style to all TreeViewItem controls?  </p>
  
  <p>Thanks --</p>