[Winodows Phone 7 control details] Silverlight toolkit for Windows Phone 7.1 control-7

Source: Internet
Author: User

8.Listpicker

When you click this control, a list will pop up. There are two types of lists, one is simple like the drop-down list box, and the other is full mode, A complete page list is displayed.

1. Simple list:

            <toolkit:ListPicker  Height="215" HorizontalAlignment="Left" Margin="86,67,0,0" Name="listPicker1" VerticalAlignment="Top" Width="283">                <sys:String>Red</sys:String>                <sys:String>Green</sys:String>                <sys:String>Blue</sys:String>            </toolkit:ListPicker>

Selectionchanged: used to respond to the selected items in the list.

2. Full mode:

<Toolkit: listpicker itemssource = "{binding}" Height = "139" horizontalalignment = "Left" margin = "6,256, 444 "name =" listpicker2 "verticalignment =" TOP "width =" "header =" Test2 "fullmodeheader =" Colors "> <Toolkit: listpicker. itemtemplate> <! -- Display --> <datatemplate> <stackpanel orientation = "horizontal"> <rectangle fill = "{binding}" width = "30" Height = "30"/> <textblock text = "{binding}" margin = "12 0 0 0"/> </stackpanel> </datatemplate> </Toolkit: listpicker. itemtemplate> <Toolkit: listpicker. fullmodeitemtemplate> <! -- Fullmode item template --> <datatemplate> <stackpanel orientation = "horizontal"> <rectangle fill = "{binding}" width = "60" Height = "60"/> <textblock TEXT = "{binding}" margin = "12 0 0 0"/> </stackpanel> </datatemplate> </Toolkit: listpicker. fullmodeitemtemplate> </Toolkit: listpicker>

Fullmodeheader: Add a title to the full mode list

Itemssource: bind the content to be displayed in the list

You can bind the displayed content in either of the following ways:

A. itemssource = "{binding}" // bind it to XAML. In this case, you must pass the list to be bound to the system's datacontext = accentcolors;

B. listpicker2.itemssource = accentcolors; // dynamically bound list items

 

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.