c# - MouseLeftButtonDown animation activates very late when clicking control -
hi have strange problem in wpf project.
i'm trying style elements on ui , want implement animations click animations or hover animations.
there no problems when creating of these animations except mouseleftbuttondown
animation.
in style implemented animation (this style
label
s):
<eventtrigger routedevent="mouseleftbuttondown"> <eventtrigger.actions> <beginstoryboard> <storyboard targetproperty="(foreground).(solidcolorbrush.color)"> <coloranimation to="#6a6a6a" duration="0:0:0.04" /> </storyboard> </beginstoryboard> </eventtrigger.actions> </eventtrigger>
my expectation foreground
of label
changes #6a6a6a whenever press left mouse button.
in fact expected animation doesn't executed 1 second after pressed left mouse button (lmb pressed -> waiting 1 sec -> color changes).
don't know why happens. other animations work fine , executed should except one.
tried change color of label
via event in code-behind because thought there might error xaml code result same delayed animation.
what can desired result?
as can see simple working example, in your code causing problem:
<textblock text="oh don't know... text"> <textblock.style> <style> <setter property="textblock.foreground" value="green" /> </style> </textblock.style> <textblock.triggers> <eventtrigger routedevent="mouseleftbuttondown"> <eventtrigger.actions> <beginstoryboard> <storyboard targetproperty="(foreground).(solidcolorbrush.color)"> <coloranimation to="red" duration="0:0:0.5" /> </storyboard> </beginstoryboard> </eventtrigger.actions> </eventtrigger> </textblock.triggers> </textblock>
nobody can tell problem because haven't shown relevant code... please don't take sentence mean add of code question... not means. if want further problem, please follow advice given in how create minimal, complete, , verifiable example page of stack overflow center provide complete, concise, working code example still exhibits problem.
when following simplification advice, 9 out of 10 times can find solution our problem anyway.
Comments
Post a Comment