简体   繁体   中英

Button click highlight list box item WP8

I have a list box with 4 items say A,B,C and D.

I have a button in the application bar,onclick of that button i need to highlight or change the background color of the list item A and B to Green.

How to achieve this ?

If you want to do in XAML,

Add the following lines inside your tag

<ListBox.Resources>
    <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Red"/>
    <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Red"/>
</ListBox.Resources>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM