0

Consider a Color element:

<Color x:Key="Color1">#FF1BA1E2</Color>

Now, I want to define another Color element based on this color with x:Key="ButtonColor", something like this:

<Color x:Key="ButtonColor">{StaticResource Color1}</Color>

how can I do that?

Jaber
  • 17
  • 6
  • Why would you like to do that?! I don't think that would be possible. – Bizhan Nov 23 '14 at 17:29
  • You would probably better declare a SolidColorBrush resource for the Button that uses the `Color1` resource. – Clemens Nov 23 '14 at 17:55
  • @Bizz because there are another objects that use Color1, and if I want to change the color of buttons, I just change the ButtonColor and not the whole colors. :) – Jaber Nov 23 '14 at 17:55
  • @Clemens, Color element is just an example, my question is more general. – Jaber Nov 23 '14 at 17:59
  • 1
    possible duplicate of [Skinning: Using a Color as StaticResource for another Color](http://stackoverflow.com/questions/4802419/skinning-using-a-color-as-staticresource-for-another-color) – Ed Chapel Nov 23 '14 at 18:05
  • @Ed Chapel the answer works fine at runtime but the designer issue is still unsolved :( – Jaber Nov 23 '14 at 18:52

0 Answers0