I know how to data bind. But i know ive done this before where i define an array of strings or ints within Xaml. Note that im referring to Silverlight xaml.
Is it something like this?
ItemsSource=”10 20 30″
ItemsSource=”10, 20, 30″
ItemsSource=”{10 20 30}”
ItemsSource=”{{10} {20} {30}}”
Note that none of the these actually work.
The first one, for instance, places each character as a separate item in the list or combobox… etc.
Don’t use
ItemsSource.ItemsSourceis specifically for binding to a collection. Controls that have anItemsSourceproperty typically have anItemsproperty. Try setting it like thisNote that each item is on it’s own line. Also, I can’t tell you the syntax off of the top of my head, but I would try to create the collection as a Resource rather than declaring it in the control. This will make it easier to reuse.