c# - Apply Radial gradient effect in listbox -
how apply radial gradient effect selected listbox item?
e.g. please review left side listbox:
i have created radialgradientbrush
follows:
<radialgradientbrush gradientorigin="0.22,0.372"> <radialgradientbrush.relativetransform> <transformgroup> <scaletransform centerx="0.1" centery="0.55" scalex="4" scaley="2"/> <translatetransform x="0.45" y="0.05"/> </transformgroup> </radialgradientbrush.relativetransform> <gradientstop offset="1" color="#00000000"/> <gradientstop color="#ffe8e8e8"/> </radialgradientbrush>
edit: misread question, updated answer.
one way achieve result you're after redefine systemcolors.highlightbrushkey
listbox
, using brush
described. brush
used highlighting, e.g:
<listbox> <listbox.style> <style targettype="{x:type listbox}"> <style.resources> <radialgradientbrush x:key="{x:static systemcolors.highlightbrushkey}" gradientorigin="0.22,0.372"> <radialgradientbrush.relativetransform> <transformgroup> <scaletransform centerx="0.1" centery="0.55" scalex="4" scaley="2"/> <translatetransform x="0.45" y="0.05"/> </transformgroup> </radialgradientbrush.relativetransform> <gradientstop offset="1" color="#00000000"/> <gradientstop color="#ffe8e8e8"/> </radialgradientbrush> </style.resources> </style> </listbox.style> </listbox>
Comments
Post a Comment