开发者

Listpicker in windows phone 7

I am trying to use the listpicker control in windows phone 7. Such that i am trying to get the value of the selected item from the listpicker.

Below is my code for the listpicker.

 this.queListPicker.ItemsSource = new List<string>() {"5", "10", "15" };

I want it to be something like when i click on the listpicker and clicked on "10" i will have a tex开发者_如何学Ctblock showing the value of 10. While when i click on 15 it will show the value of 15 in the text block

How should i go about doing it?


You can handle the SelectionChanged event of the listpicker. You can then get the corresponding argument (such as the item being selected) using the SelectionChangedEventArgs of the event. Many list controls such as ListBox has similar approach (same event), so you might want to get started from ListBox.


Use a binding to picker.SelectedItem

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜