Jens Borrisholt
Jens Borrisholt

Reputation: 6402

Use custom Color in SolidColorBrush

I have a ResourceDictionary where I have defined some custom colors:

<Color x:Key="BMWhite">White</Color>
<Color x:Key="BMRed">Red</Color>

These new colors I want to use in at SolidBrush :

<SolidColorBrush x:Key="ApplicationBackgroundColor1" Color="BMWhite"/>

But it is not a valid syntax (so VSS says).

Can this be done some how?

Upvotes: 1

Views: 131

Answers (1)

TeeT
TeeT

Reputation: 46

I think you should try like this.

<SolidColorBrush x:Key="ApplicationBackgroundColor1" Color="{StaticResource BMWhite}"/>

Upvotes: 1

Related Questions