问题标签 [wpf-animation]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
514 浏览

wpf - 动画 wpf - 显示 n 秒然后淡出

我有一个故事板,它DoubleAnimation可以在一秒钟内将不透明度从 1 设置为 0:

淡出动画非常快,这就是目的。但是我怎样才能制作一个动画来显示控件 n 秒然后开始这个淡出动画呢?

我尝试在当前的 DoubleAnimation 之上创建一个新的 DoubleAnimation ,带有值From="1"To="1"和 a Duration="5",但这似乎确实有效。有任何想法吗?

0 投票
2 回答
1872 浏览

c# - 值更改时为文本框背景设置动画

我想根据 ViewModel 的新值设置文本框(价格)背景颜色的动画。

颜色可以根据新值不同(大于 0 -> 绿色 - 小于 0 -> 红色)

我能看到的唯一动画是在设置新值时启动。之后动画将不再出现。

价格可能每秒变化几次,因此我需要在设置新价格值时中止正在运行的动画。

0 投票
1 回答
701 浏览

wpf - WPF Validation.ErrorTemplate 背景对象

我想替换 Validation.ErrorTemplate 的正常行为。我想在我自己的 UserControl 后面放置一个背景边框对象(用红色填充),然后应用一个简单的彩色动画来闪烁它。

我在我的隐式控制风格中尝试了这个:

不幸的是,边框对象完全覆盖了控件 UI。另一个问题是:将 DoubleAnimation 应用于 Opacity 以使我的背景闪烁的正确位置在哪里?我应该触发哪些属性/事件?我应该使用样式还是简单地将其放在 Border.Triggers 中?

谢谢

0 投票
4 回答
4085 浏览

wpf - 动画宽度从右到左

我想为从屏幕右边缘进入的窗口设置动画。

这是我的xml

但它动画宽度从左到右而不是从右到左。像这样:

在此处输入图像描述 在此处输入图像描述

我怎样才能改变它,让它从边缘进来?

0 投票
1 回答
478 浏览

wpf - WPF 动画只向一个方向移动

我有一系列触发器来控制应该上下移动的栏。每次给它一个随机选择的值时,它都会滑到适当的位置:

但由于某种原因,它只会向上移动。它应该再次向下移动的部分,它就坐在那里。在更改之间停止动画只会导致它从底部重新开始,这不是我想要的。

0 投票
1 回答
2134 浏览

c# - Change Duration of DoubleAnimation Control by Slider

I'm trying to change duration of DoubleAnimation control by Slider's value but it does not get effect. I don't know why?

Here's my code:

XAML:

C#:

Any help would be appreciate! Thanks in advance.

0 投票
1 回答
176 浏览

wpf - 在开始动画期间做了一些工作。WPF

我正在我的 wpf 应用程序中制作一个 sartup 动画屏幕。我想在那个动画期间做一些工作。这个怎么做 ?我想在那段时间做一些粘性的东西?这样我的应用程序在那个动画之后运行得更快。

我怎样才能做到这一点 ?

0 投票
2 回答
2472 浏览

wpf - 在wpf中滚动多个图像

我有这段代码可以循环滚动网格中的单个图像。
现在我有 2 张图片 1(红色)和 2(黄色)看起来像这样。在此处输入图像描述 它会循环滚动

0 投票
1 回答
63 浏览

wpf - Button Design Issue

On my application I have a side bar which looks like this:

enter image description here

The Admin bit is just a header

Now at the moment I have coded these to be Buttons. They don't really have any effect on the click or anything. I want to change these to TabItems so it has the effect of coming out to the side.

I have tried doing this but when I add a width to a TabItem the effect goes and it just looks like a Button.

enter image description here

As you can see that the TabItem just looks like a Button, the effect has gone.

Do you guys have any suggestions on what I could do to make mine look better with an Animation or how I can fix the TabItem issue?

EDIT:

I have changed my TabItems to Buttons, but I am having a massive problem. I have 10 different buttons on the left hand side and when I click one, the animation appears and it ends up like this:

enter image description here

But as you can see from the picture, when I click another button below the same animation happens but the previous button clicked doesn't go back to the normal state.

How can reset the storyboard animation on the previous clicked button, when I click another button.

0 投票
1 回答
953 浏览

wpf - 触发属性以将情节提要重新启动到第一个状态

我有 2 个触发事件,都带有 an<Trigger.EnterActions>和 a <Trigger.ExitActions>,这些是IsPressedand also IsMouseOver

当我单击一个按钮时,它将播放<Trigger Property="IsPressed" Value="True">故事板:

这与这个故事板相关联:

不同的按钮也链接到同一个故事板。单击第二个按钮时,我希望它按原样播放情节提要,然后让第一个按钮返回正常状态。这是故事板的这一部分。

单击第二个按钮时,如何触发第一个按钮重置为正常