ListBox Style Selected item on windows phone

前端 未结 1 651
耶瑟儿~
耶瑟儿~ 2021-02-14 04:13

i would like know how can i add a style when a item of the listbox is selected. I have the following listbox:



        
相关标签:
1条回答
  • 2021-02-14 04:52

    You have to change the style of the template ListBoxItem which the ListBox generates for each of the items that it renders. Your updated template needs to customise the Selected visual state. You can then associate this new template with your ListBox via the ListBox.ItemContainerStyle property.

    There is a good tutorial, with sourcecode to download, here:

    http://windowsphonegeek.com/tips/How-to-customize-the-WP7-ListBox-Selected-Item--Part1-Control-Template

    0 讨论(0)
提交回复
热议问题