Reputation: 54949
I am new to Windows Phone development and i want to create a simple ListBox.
I have an Array with 10 Names which i want to display in a list Box.
string[] names = new string[10] {"Matt", "Joanne", "Robert", .........};
Now i want to use this Array to feed the listBox dynamically and show it.
Can someone help me with an Example on how to do this.
Upvotes: 0
Views: 171
Reputation: 6424
You have to set the array as the ItemSource for the ListBox:
listBox.ItemSource = names;
Upvotes: 1
Reputation: 840
I'm not familiar with Windows Phone development, but in winforms it'd be listbox.Items.AddRange(names);
Upvotes: 1