所以,我正在制作一个应用程序,我想逐渐(在几秒钟内)缩小图像控件,直到它消失。因此,我基本上将 ScaleTransform 与 DoubleAnimation 绑定在一起,但它会立即发生。这是我的代码:
DoubleAnimation anim = new DoubleAnimation(360, 0, (Duration)TimeSpan.FromSeconds(1));
ScaleTransform st = new ScaleTransform();
st.ScaleX = 0;
st.ScaleY = 0;
PACSCore.RenderTransform = st;
anim.Completed += (s, _) => Exit_PACS();
st.BeginAnimation(ScaleTransform.ScaleYProperty, anim);