Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to properly define Colors in Resource Dictionaries?

The following doesn't work, runtime tells me it cannot convert #FFFFFFAE to a color.

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Color x:Key="ItemHeaderBack" >#FFFFFFAE</Color>

</ResourceDictionary>
like image 838
codymanix Avatar asked Dec 18 '10 16:12

codymanix


1 Answers

I tried using your exact definition like this and it worked. How do you use it?

<Canvas.Background>
    <SolidColorBrush Color="{StaticResource ItemHeaderBack}"/>
</Canvas.Background>
like image 163
Fredrik Hedblad Avatar answered Oct 03 '22 14:10

Fredrik Hedblad