c# - ColorAnimation to animate the listviewItem color on Swipe - WP8.1 -
c# - ColorAnimation to animate the listviewItem color on Swipe - WP8.1 -
i'm trying alter color of listview item on swipe right using next story board, throws exception says
winrt information: coloranimation cannot used animate property background due incompatible type. additional information: no installed components detected.
this code i've used. written in manipulationdelta event
grid channelgrid = (grid)sender; grid deletegrid = (grid)((grid)(channelgrid.parent)).children[1];
the grids item template listviewitem , manipulation events wired.
else if (e.position.x - initialpoint.x > 30 && channelgrid.width == 380) // swipe right { e.complete(); storyboard swiperight = new storyboard(); coloranimation changecoloranimation = new coloranimation(); changecoloranimation.enabledependentanimation = true; changecoloranimation.to = colors.green; changecoloranimation.duration = new duration(timespan.frommilliseconds(100)); storyboard.settarget(changecoloranimation, channelgrid); storyboard.settargetproperty(changecoloranimation, "background");//**wrong** swiperight.children.add(changecoloranimation); swiperight.begin(); }
found solution :d targetproperty causes exception. need set target property following
propertypath p = new propertypath("(channelgrid.background).(solidcolorbrush.color)"); storyboard.settargetproperty(changecoloranimation, p.path);
and not
storyboard.settargetproperty(changecoloranimation, "background");//**wrong**
c# windows-phone-8 windows-runtime listviewitem coloranimation
Comments
Post a Comment