Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1235
Can I feed custom colors using (A)RGB syntax or binding them via MVVM?
posted

Hello,

I tried doing something like:

<ig:XamColorPicker.ColorPalettes>

  <!-- Create Custom Palette -->

    <!--<ig:ColorPalette>

        <ig:ColorPalette.Colors>

            <ig:ColorPatchCollection>

                <ig:ColorPatch Color="242, 108, 79"/>

            </ig:ColorPatchCollection>

        </ig:ColorPalette.Colors>

    </ig:ColorPalette>-->

<!--</ig:XamColorPicker.ColorPalettes> 

It want build. I tried also using                 <ig:ColorPatch Color="255, 242, 108, 79"/> with same results.

I do have a custom palette, carefully chosen from the Photoshop Swatches that looks like the following:

 public static IEnumerable<Color> OwnerColors
        {
            get
            {
                List<Color> ownerColors = new List<Color>();
                ownerColors.Add(Color.FromArgb(242, 108, 79));
                ownerColors.Add(Color.FromArgb(246, 142, 86));
                ownerColors.Add(Color.FromArgb(251, 175, 93));
                ownerColors.Add(Color.FromArgb(255, 244, 104));
                ownerColors.Add(Color.FromArgb(172, 211, 115));
                ownerColors.Add(Color.FromArgb(124, 197, 118));
                ownerColors.Add(Color.FromArgb(60, 184, 120));
                ownerColors.Add(Color.FromArgb(28, 187, 180));
                ownerColors.Add(Color.FromArgb(0, 191, 243));
                ownerColors.Add(Color.FromArgb(68, 104, 202));
                ownerColors.Add(Color.FromArgb(85, 116, 185));
                ownerColors.Add(Color.FromArgb(96, 92, 168));
                ownerColors.Add(Color.FromArgb(133, 96, 168));
                ownerColors.Add(Color.FromArgb(168, 99, 168));
                ownerColors.Add(Color.FromArgb(240, 110, 169));
                ownerColors.Add(Color.FromArgb(242, 109, 125));
                return ownerColors;
            }
        }

Is there a way I could bind it to the colors of the xamColorPicker? Possiblu something that works
both in Silverlight and WPF.
Thanks
Roberto 

Parents Reply Children
No Data