小编Tar*_*ras的帖子

Wpf动画背景颜色

我需要帮助才能做出正确的决定.当某些事件发生时,我需要为我的用户控件的背景颜色设置动画.如果是,我想改变背景只需1秒然后再将其转回.我该走哪条路?使用颜色动画或计时器或可以通过其他方式.

解决了.谢谢大家!这对我有好处:

        ColorAnimation animation;
        animation = new ColorAnimation();
        animation.From = Colors.Orange;
        animation.To = Colors.Gray;
        animation.Duration = new Duration(TimeSpan.FromSeconds(1));
        this.elGrid.Background.BeginAnimation(SolidColorBrush.ColorProperty, animation);
Run Code Online (Sandbox Code Playgroud)

c# wpf animation colors coloranimation

48
推荐指数
3
解决办法
7万
查看次数

代码隐藏的绑定字符串格式?

请问,有些人可以告诉我如何从代码隐藏中获取格式为"0.0"的双值,如下所示:

Binding b = new Binding(DoubleValue);
b.StringFormat = "????";
Run Code Online (Sandbox Code Playgroud)

在xaml中,它就像"0.0"一样...

wpf binding string-formatting

2
推荐指数
1
解决办法
1万
查看次数