0

I have an ObservableCollection<Color> dependency property in my CustomControl, which I want to parametrize on each instantiation, preferably in XAML:

            <clb:ColorListBox.StandardColors>
                <local:ObservableColorCollection>
                    <Color R=255 G=0 B=0 />
                    <Color ... /
                </local:ObservableColorCollection>                    
            </clb:ColorListBox.StandardColors>

How can I declare the colors by name?

(Btw: the ObservableColorCollection is defined this way in the codebehind)

G. B.
  • 528
  • 2
  • 15

1 Answers1

0

Nevermind, I found the answer

            <clb:ColorListBox.StandardColors>
                <local:ObservableColorCollection>
                    <Color>Red</Color>
                    <Color>Green</Color>
                    <Color>Blue</Color>
                    <Color>#8F8F8F</Color>
                </local:ObservableColorCollection>                    
            </clb:ColorListBox.StandardColors>
G. B.
  • 528
  • 2
  • 15