Switching colors using multi ResourceDirectory RRS feed

  • Question

  • Hi all,

    is it possible to switch color scheme's using organized resource directories?

    My resource directory have the same names. For example my blue color directory, purple, pink, etc has:
    IsNormal Forecolor
    IsNormal Backcolor

    My other color resources have the same names and is it possible to switch the colors easly that way?

    I use IsNormal backcolor,fore is because of the states. I also have IsMouseOver, IsPressed, and IsDisabled for those color states.

    Here is xmal of one of my resource directories:

    	<Color x:Key="IsNormal Forecolor">White</Color>
    	<Color x:Key="IsNormal Backcolor">#FF345B82</Color>
    	<Color x:Key="IsMouseOver Backcolor">#FF4F7296</Color>
    	<Color x:Key="IsMouseOver Forecolor">#FF839CB5</Color>
    	<Color x:Key="IsPressed Backcolor">White</Color>
    	<Color x:Key="IsPressed Forecolor">#FF345B82</Color>
    	<Color x:Key="IsDisabled Backcolor">#3F345B82</Color>
    	<Color x:Key="IsDisabled Forecolor">#3FFFFFFF</Color>
    	<!-- Resource dictionary entries should be defined here. -->
    What im trying to do is fastly switch my buttons, toggle buttons, etc with different colors from the states. so i wont need to make a whole bunch of controls with different colors.

    I also thought it would work this way because my controls use the same name values but when i try to switch the directory i get errors.
    Saturday, January 30, 2010 7:21 AM

All replies