2013-04-17 30 views
0
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); 

這是我用來做動畫的一個,但是它以未來爲中心。我想它應該堅持到窗口的底部。如何在動畫中以wpf從下到上顯示窗口

如何實現這一目標?請分享一些想法。

+0

該解決方案是否適合您? – Avishek

回答

0

你爲什麼把heightAvail分爲2?

int heightAvail = (screenHeight - intHeight); 

這應該這樣做。