How to define colors in resource dictionaries?

The following work does not work, the runtime tells me that it cannot convert #FFFFFFAE to 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> 
+7
source share
1 answer

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

 <Canvas.Background> <SolidColorBrush Color="{StaticResource ItemHeaderBack}"/> </Canvas.Background> 
+8
source

All Articles