animation - Silverlight - Animating Rectangle stroke in Code Behind -
i want able fade in border in code behind (c#) when user hovers on rectangle in application.
i've seen few examples of creating animations in code behind cannot them work instance.
as can see, have mouseenter event @ moment, created border around object want fade in (and out when have mouseleave event)
can please understand need?
private void imagerect_mouseenter(object sender, mouseeventargs e) { solidcolorbrush bluebrush = new solidcolorbrush(); bluebrush.color = systemcolors.highlightcolor; imagerect.strokethickness = 3; imagerect.stroke = bluebrush; }
thanks much
shaun
try use when want create storyboard in code behind.
storyboard strybrd = new storyboard(); var mycolor = new coloranimation { }; storyboard.settarget(mycolor, imagerect); storyboard.settargetproperty(mycolor, new propertypath("(rectangle.stroke).(solidcolorbrush.color)")); mycolor.to = color.fromargb(255, 150, 150, 151); strybrd.begin();
Comments
Post a Comment