Q:

How to make a listview and add populate it?

I'm new to windows phone 8 development and I can't find a way to add a listview control and populate it with items.
Could someone help me a lil.bit?
Thanks

A:

ListBox structure is similiar to ListView.You just try this.If you don't know MVVM architecture, try to learn the basics of that.
<ListBox ItemTemplate="{StaticResource MasterTemplate}"
         ItemsSource="{Binding ItemLists}"  
         HorizontalAlignment="Stretch">
  <ItemTemplate>
    <DataTemplate>
        <TextBox Text="{Binding Name,Mode=TwoWay}"/>
    </DataTemplate>
  </ItemTemplate>
</ListBox>

The above shows the view.In the viewmodel,you can just declare a observablecollection like this.
public ObservableCollection<ProductModel> ItemLists{get;set;}

Then initialize the list like this,
ItemLists=new ObservableCollection<ProductModel>();

Then add elements to list and it will automatically display in the view because of binding.
private void addProducts()
{
  for(int i=0;i<5;i++)
  {
     ItemLists.Add(new ProductModel{Name="Product"});
  }
}

This is the simple example.In the productmodel,you just declare the name property.
private string name;

public string Name
{
  get{return name;}
  set
  {
    name=value;
    OnPropertyChanged("Name");
  }
}

