c# - How to Highlight a Selected Item in LongListSelector -


i show border around selected item in longlistselector. have set itemtemplate longlistselector, unsure of how modify border selected item contains border.

mainpage.xaml

<phone:phoneapplicationpage.resources>     <datatemplate x:key="itemtemplate">         <!-- borderbrush of items set phoneaccentbrush, need selected item! -->         <border x:name="brd" cornerradius="10" borderbrush="{staticresource phoneaccentbrush}" width="auto" borderthickness="3">             <viewbox width="108" height="108">                 <image x:name="recentimage" source="{binding source}" margin="6,6" width="108"/>             </viewbox>             <toolkit:contextmenuservice.contextmenu>                 <toolkit:contextmenu x:name="imglistcontextmenu" background="{staticresource phonechromebrush}">                     <toolkit:menuitem foreground="{staticresource phoneforegroundbrush}" header="delete" click="deletecontextmenuitem_click"/>                 </toolkit:contextmenu>             </toolkit:contextmenuservice.contextmenu>         </border>     </datatemplate>  </phone:phoneapplicationpage.resources>  ...  <phone:longlistselector x:name="recent" margin="0"                                      selectionchanged="recent_selectionchanged"                                      toolkit:tilteffect.istiltenabled="true"                                     layoutmode="grid" gridcellsize="108,108"                                     itemtemplate="{staticresource itemtemplate}"                                     /> 

currently of items within longlistselector show border. prefer modify in code behind, have far not work

mainpage.xaml.cs

private void recent_selectionchanged(object sender, selectionchangedeventargs e)     {                     var item = sender  longlistselector         item.borderbrush = app.current.resources["phoneaccentbrush"] solidcolorbrush;     } 

any ideas?

refer link ,

highlight selected item in longlistselector on wp8 http://code.msdn.microsoft.com/wpapps/highlight-a-selected-item-30ced444


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -