.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
Post a Comment