title: How to access a property of a resource in xaml
body: <p>In XAML I have resources in an external resource dictionary, something like this:</p>
  <pre><code>&lt;SolidColorBrush x:Key=&quot;Foo&quot;
                   Color=&quot;#FFFF0000&quot; /&gt;
  
  &lt;SolidColorBrush x:Key=&quot;Bar&quot;
                   Color=&quot;#FF00FF00&quot; /&gt;
  </code></pre>
  <p>I can't change this external resource dictionary.</p>
  <p>I have a color collection in my XAML, something like this:</p>
  <pre><code>&lt;MyObject&gt;
      &lt;MyObject.Colors&gt;
          &lt;Color&gt;#FFFF0000&lt;/Color&gt;
          &lt;Color&gt;#FF00FF00&lt;/Color&gt;
      &lt;/MyObject.Colors&gt;
  &lt;/MyObject&gt;
  </code></pre>
  <p>I'd like to somehow use the <code>Color</code> of these <code>Brush</code> objects from the external resources to put it inside my color collection, something like:</p>
  <pre><code>&lt;MyObject&gt;
      &lt;MyObject.Colors&gt;
          &lt;StaticResource ResourceKey=&quot;Foo&quot; Path=&quot;Color&quot; /&gt;
          &lt;StaticResource ResourceKey=&quot;Bar&quot; Path=&quot;Color&quot; /&gt;
      &lt;/MyObject.Colors&gt;
  &lt;/MyObject&gt;
  </code></pre>
  <p>Of course this <code>&lt;StaticResource ResourceKey=&quot;Foo&quot; Path=&quot;Color&quot; /&gt;</code> doesn't work, but is there a way to have access to a property of a resource?</p>