ControlTemplate Storyboard color animation problem

后端 未结 3 1648
生来不讨喜
生来不讨喜 2021-01-13 12:04

I have a problem with color animation. This is my source:

 
    

        
3条回答
  •  心在旅途
    2021-01-13 12:32

    You cannot freeze Bindings, you probably can get around this issue by declaring a color as a resource and then bind your Control's Background to it while using StaticResource in the animation.

    e.g.

    
        
    
    
        Green
    
    
    
    

    Alternative using a resource class:

    public static class MyColors
    {
        public static Color MyHighlightColor = Color.FromArgb(255, 0, 88, 0);
    }
    
    
    

提交回复
热议问题