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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -