I would like to be able to do the following:
...
<Grid>
<Grid.Resources>
<Color x:Key="MyColor">#FFEEDD</Color>
<Color x:Key="MyOtherColor">Green</Color>
<!-- Use MyColor and MyOtherColor to define other resources... -->
</Grid.Resources>
</Grid>
Unfortunately, I am forced to do this instead:
...
<Grid>
<Grid.Resources>
<Color x:Key="MyColor" A="255" R="255" G="238" B="221" />
<Color x:Key="MyOtherColor" A="255" R="0" G="128" B="0" />
<!-- Use MyColor and MyOtherColor to define other resources... -->
</Grid.Resources>
</Grid>
Because, it seems that value converters are not kicking in. This is a royal pain in the rump and I was wondering what I can do, so that I can define my colors symbolically and by hex value?
Static resources are resources not assigned to a path network and therefore do not visibly move. A static resource may be needed to perform an operation at only one location, such as an inspection operator, and will appear during the entire simulation in the same place it was defined graphically.
Static Resources retrieved once by referencing element and used for the lifetime of the resources. Whereas, DynamicResources retrieve every time they are used. The downside of Dynamic resources is that they tend to decrease application performance.
Static resources allow you to upload content that you can reference in a Visualforce page, including archives (such as . zip and . jar files), images, style sheets, JavaScript, and other files. Static resources can be used only within your Salesforce org, so you can't host content here for other apps or websites.
I'm not sure I understand your problem. I tried this and it's working. How are you using your Color Resources?
<Grid>
<Grid.Resources>
<Color x:Key="MyColor">#FFEEDD</Color>
<Color x:Key="MyOtherColor">Green</Color>
</Grid.Resources>
<Rectangle>
<Rectangle.Fill>
<SolidColorBrush Color="{StaticResource MyColor}"/>
</Rectangle.Fill>
</Rectangle>
</Grid>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With