简体   繁体   中英

Binding Listbox to Array of Lists

I have 10 Listboxes and an array of 1000 Lists of string. I need to fill the listboxes from the Array dpending on the Array Index. Is this possible with binding or have to do it manually?

<ListBox ItemsSource="{Binding MyArrayOfLists[0]}".../>
<ListBox ItemsSource="{Binding MyArrayOfLists[1]}".../>
<ListBox ItemsSource="{Binding MyArrayOfLists[3]}".../>
...

Is that what you mean?

I mean this statment is not possible right in XAML? But can it be done through code?


I have listboxes named listBox1, listBox2, listBox3 etc. Is there a way to name then like an array - listbox[1], listbox[2], listbox[3] - so that I can access them like an array - listBox[Index]?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM