In XAML, you can do something like this:
<ListView name="myListView">
<ListViewItem>test1</ListViewItem>
<ListViewItem>test2</ListViewItem>
</ListView>
This will populate some test items in the displayed list. You will need to clear the collection of list items before you attach to it, or you will get an exception:
myListView.Items.Clear()
source
share