Using TemplateBinding in ObjectAnimationUsingKeyFrames

后端 未结 2 1016
不思量自难忘°
不思量自难忘° 2021-01-24 05:52

I try to set the background color of a control when mouse is over it. I try to do it via the visual state manager. I was able to get the following code running:

         


        
2条回答
  •  清歌不尽
    2021-01-24 06:15

    Unfortunately the way you're trying to do it won't work in Silverlight. The VisualStateManager animations are not part of the display tree, so you can't use binding. You have options though, StaticResources (aka setting up colours in the resource dictionary) and code based animations are different workarounds (depending on exactly what you want to do). For the latter check out a thread where I asked a similar question: How can I animate a property dynamically in a Silverlight 4 UserControl?

提交回复
热议问题