.net - Alternating row color for Listbox using MahApps.Metro -


i'm trying create alternating row color listbox in wpf while using mahapps.metro project. when add style , triggers, background of items still white:

        <style targettype="listbox">             <setter property="alternationcount" value="2" />             <style.triggers>                 <trigger property="itemscontrol.alternationindex" value="1">                     <setter property="background" value="blue" />                 </trigger>             </style.triggers>         </style> 

apply style on listboxitem instead of listbox, this:

<listbox alternationcount="2">     <listbox.resources>         <style targettype="listboxitem">             <style.triggers>                 <trigger property="itemscontrol.alternationindex" value="1">                     <setter property="background" value="blue" />                 </trigger>             </style.triggers>         </style>     </listbox.resources> </listbox> 

don't forget add alternationcount listbox, no longer being set in style


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -