Windows 8 Store Apps Learning (5) Collection control

Source: Internet
Author: User
Tags xmlns

ComboBox, ListBox, Flipview, itemscontr

Introduced

Re-imagine the Windows 8 Store Apps Collection Control

ComboBox-Dropdown box

ListBox-list box

Flipview-Slide View Control

ItemsControl Itemspresenter-itemspresenter is used to render ItemsControl Items

Example

1, ComboBox's Demo

Comboboxdemo.xaml

<page x:class= "XamlDemo.Controls.ComboBoxDemo" 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 "> <grid background=" Transparent "> <st Ackpanel margin= "0 0 0" > <!--ComboBox-dropdown box--> <!-- XAML method adds data to ComboBox--> <combobox x:name= "ComboBox" width= "5" margin= "left" & 

  
                Gt   
                <comboboxitem content= "ComboBoxItem1"/> <comboboxitem content= "ComboBoxItem2"/>   
                <comboboxitem content= "ComboBoxItem3"/> </ComboBox> <!-- The background binding method isComboBox Add Data DisplayMemberPath-Specifies the name of the field that needs to be displayed in the data source maxdropdownheight-for specifying the open drop-down box Maximum height--> <combobox x:name= "comboboxwithbinding" displaymemberpath= "Name" Maxdropdownheig ht= "Width=" margin= "5" horizontalalignment= "left"/> <!--to set the layout and data for each item of ComboBox through a template- -> <combobox itemssource= "{Binding ItemsSource, elementname=comboboxwithbinding}" maxdropdownheight= "100   
                    "Width=" margin= "5" horizontalalignment= "left" > <ComboBox.ItemTemplate>   
                            <DataTemplate> <stackpanel orientation= "Horizontal" > <textblock text= ' {Binding Name} '/> <textblock text= ' {Binding age} ' margin=   
                "5 0 0 0"/> </StackPanel> </DataTemplate> </combobox.itemtemplate> </ComboBox> </StackPanel> </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.