First we need to install Windows 8 and VS2012, download the address: http://msdn.microsoft.com/zh-CN/windows/apps/br229516/
Then we open VS2012, select Windows Metro Style, and then choose to create the blank app project as shown below:
The new completed project structure is as follows:
We drag a button and a ListBox into the interface, set the button events and the DataTemplate of the ListBox, as follows XAML code:
<grid background= "{StaticResource Applicationpagebackgroundthemebrush}" >
<button Content= "button" Name= "Button1" horizontalalignment= "left" margin= "135,124,0,0" verticalalignment= "Top
" click= "Button1_Click"/ >
<listbox horizontalalignment= "left" Name= "ListBox1" height= "margin="
Verticalalignment= "Top" width= "140" >
<ListBox.ItemTemplate>
<DataTemplate>
< TextBlock width= "text=" {Binding itemname} "/>
</DataTemplate>
</listbox.itemtemplate >
</ListBox>
</Grid>