Windows 8 Store Apps Learning (one) ListView controls and GridView controls

Source: Internet
Author: User
Tags xmlns

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>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.