/// <summary> /// 设置并计算界面元素正确的位置 /// </summary> private void SetControlPosition() { double HorizonLocation = SplashImageRect.X + (SplashImageRect.Width * 0.5); double VerticalLocation = SplashImageRect.Y + (SplashImageRect.Height * 0.75); SplashProgressRing.SetValue(Canvas.LeftProperty, HorizonLocation - (SplashProgressRing.Width * 0.5)); SplashProgressRing.SetValue(Canvas.TopProperty, VerticalLocation); Display.SetValue(Canvas.LeftProperty, HorizonLocation - (Display.Width * 0.5)); Display.SetValue(Canvas.TopProperty, VerticalLocation + SplashProgressRing.Height + 20); Continue.SetValue(Canvas.LeftProperty, HorizonLocation - 75); Continue.SetValue(Canvas.TopProperty, VerticalLocation + SplashProgressRing.Height + Display.Height + 20); Cancel.SetValue(Canvas.LeftProperty, HorizonLocation + 5); Cancel.SetValue(Canvas.TopProperty, VerticalLocation + SplashProgressRing.Height + Display.Height + 20); extendedSplashImage.SetValue(Canvas.LeftProperty, SplashImageRect.X); extendedSplashImage.SetValue(Canvas.TopProperty, SplashImageRect.Y); extendedSplashImage.Height = SplashImageRect.Height; extendedSplashImage.Width = SplashImageRect.Width; }