static int screenWidth = (int)SystemParameters.WorkArea.Width;
static int screenHeight = (int)SystemParameters.WorkArea.Height;
int heightAvail = ((screenHeight - intHeight) / 2);
int widthAvail = ((screenWidth - intWidth) / 2);
DoubleAnimation animation = new DoubleAnimation(widthAvail, widthAvail, TimeSpan.FromMilliseconds(300));
DoubleAnimation animationT = new DoubleAnimation(1920, heightAvail, TimeSpan.FromMilliseconds(300));
objUIElement.BeginAnimation(Window.LeftProperty, animation);
objUIElement.BeginAnimation(Window.TopProperty, animationT);
这是我用来做动画的一个,但它来到了中心。我希望它应该粘在窗口的底部。
如何做到这一点?请分享一些想法。