Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
Accessing a colour in a style resource
posted

Hi,

 

I am trying to access a colour within a style resource like so:

 

public static Color COLOR_ONE;

public static Appearance APPEARANCE_ONE = new Appearance();

static Constant ()

{

APPEARANCE_ONE.StyleResourceName = "ResourceOne";

COLOR_ONE = APPEARANCE_ONE.BackColor;

}

 

So I would like COLOR_ONE to be the background colour of ResourceOne.

However the issue here is that the BackColor of APPEARANCE_ONE is still set to the default of 0,0,0,0, presumably because it just ignores this and looks at the StyleResource.

Is there any way to point this directly to the BackColor of the StyleResource?

 

Thanks very much in advance,

Alastair