c# - WPF bubbling mouseenter and mouseleave events for animation purposes -
in application there control, contains amount of cards, on each of them togglebutton placed. apply effects on mouseenter card, , apply effect on button, when mouse if on it, not declining effect of card. mouseenter , mouseleave events not bubble events, catchs in control , disapears. simpliest way resolve collision?
this simplified xaml code.
xaml
<grid> <image source="{binding path=posterpath, converter={staticresource imageconverter}}" opacity="1.0"> <image.effect> <dropshadoweffect ... /> </image.effect> <image.triggers> <eventtrigger routedevent="image.mouseenter"> <beginstoryboard storyboard="{staticresource showmenuanimation}"/> </eventtrigger> <eventtrigger routedevent="image.mouseleave"> <beginstoryboard storyboard="{staticresource hidemenuanimation}"/> </eventtrigger> </image.triggers> </image> <togglebutton x:name="bplay" ... ischecked="{binding path=(common:commonviewsettings.alwaysfalse), mode=twoway}" style="{dynamicresource metrocircletogglebuttonstyle}" foreground="{dynamicresource linkedtextbrush}" visibility="hidden" borderbrush="{dynamicresource linkedtextbrush}"> <rectangle fill="{binding path=foreground, relativesource={relativesource findancestor, ancestortype={x:type togglebutton}}}"> <rectangle.opacitymask> <visualbrush stretch="fill" visual="{dynamicresource appbar_control_play}"/> </rectangle.opacitymask> </rectangle> <togglebutton.triggers> <eventtrigger routedevent="button.mouseenter"> <beginstoryboard storyboard="{staticresource showborderbrush}"/> </eventtrigger> <eventtrigger routedevent="button.mouseleave"> <beginstoryboard storyboard="{staticresource hideborderbrush}"/> </eventtrigger> </togglebutton.triggers> </togglebutton>
Comments
Post a Comment