I am trying to display an amount of colorpicker controls depending on an amount of colors in a xaml resourcedictionary file.
For some reason I can't figure out the right way to do this. When loading it in through a XAMLReader to a ResourcesDictionary Object, I m not sure what is the best way to iterate over it.
I had first tried to handle it as xml, using XDocument.Elements() which gave an empty IEnumerable when trying to get al the elements.
What is the best way to do this ?
example of the xaml:
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Edit the FontFamily value to change the application font-->
<FontFamily x:Key="NormalFontFamily">Arial</FontFamily>
<!-- Edit ARGB values (hex) to change the colours used in the application -->
<Color x:Key="NormalForegroundColor" A="0xFF" R="0xFF" G="0xFF" B="0xFF" />
<Color x:Key="NormalForegroundColor80" A="0xFF" R="0xB6" G="0xB5" B="0xB5" />
<Color x:Key="DarkerForegroundColor" A="0xFF" R="0x97" G="0x97" B="0x97" />
<Color x:Key="DarkestForegroundColor" A="0xFF" R="0x76" G="0x76" B="0x76" />
<Color x:Key="NormalBackgroundColor" A="0xFF" R="0x22" G="0x22" B="0x22" />
<Color x:Key="DarkerBackgroundColor" A="0xFF" R="0x19" G="0x19" B="0x19" />
<Color x:Key="LighterBackgroundColor" A="0xFF" R="0x33" G="0x33" B="0x33" />
....