Introduced
Re-imagine the ListView and GridView of Windows 8 Store Apps
ListView-List control
GridView-Grid Control
Example
1, ListView's Demo
Listviewdemo.xaml
<page x:class= "XamlDemo.Controls.ListViewDemo" xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentati On "xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "xmlns:local=" using:XamlDemo.Controls "xmlns:d=" http ://schemas.microsoft.com/expression/blend/2008 "xmlns:mc=" http://schemas.openxmlformats.org/ markup-compatibility/2006 "mc:ignorable=" D "> <Page.Resources> <datatemplate x:key=" Itemte Mplate "> <stackpanel orientation=" Vertical "> <textblock textwrapping=" Wrap "Fontsi Ze= "14.667" text= "{Binding Name}" horizontalalignment= "left"/> <textblock "textwrapping=" Wrap Ize= ' 14.667 ' text= ' {Binding age} ' horizontalalignment= ' left '/> </StackPanel> </datatemplat e> <style x:key= "Itemcontainerstyle" targettype= "ListViewItem" > <setter "Width" value= "292"/> <setter property= "Height "value="/> <setter property= "Padding" value= "0"/> <!--even if the
Margin set to "0" and cannot remove Margin between item if you want to remove the Margin between the item, set this Margin property to "-4"-->
<setter property= "Margin" value= "0"/> <setter property= "Background" value= "Blue"/> </Style> </Page.Resources> <grid background= "Transparent" > <grid margin= "120 0 0 0 "> <textblock name=" lblmsg "fontsize=" 14.667 "/> <stackpanel orientation= "Horizontal" verticalalignment= "top" margin= "0 0 0" > <checkbox name= chkisswipeenabled "content=" Isswipeenabled "/> <checkbox name=" chkisitemclickenabled "content=" isitemclickenabled "Margin=" 10 0 0 0 "/> </StackPanel> <!--background bindings provide data--> <listview x for ListView: Name= "ListView" width= "3Verticalalignment= "Top" horizontalalignment= "left" margin= "0" borderthickness= "1" borderbrush= "Red" backgr Ound= "LightBlue" itemtemplate= "{StaticResource ItemTemplate}" itemcontainersty Le= "{StaticResource Itemcontainerstyle}" scrollviewer.verticalscrollbarvisibility= "Auto" ScrollViewe R.horizontalscrollbarvisibility= "Auto" selectionmode= "single" selectionchanged
= "Listview_selectionchanged_1" isswipeenabled= "{Binding ischecked, elementname=chkisswipeenabled}" Isitemclickenabled= "{Binding ischecked, elementname=chkisitemclickenabled}" Ite mclick= "Listview_itemclick_1" > </ListView> <!--XAML mode is ListView Add Content <ListView> <ListView.Items> <listviewitem
> ... </ListViewItem> <ListViewItem> ... </ListViewItem> ... </listview.i tems> </ListView>--> </Grid> </Grid> </Page>