void ShowLogin(object sender, MouseButtonEventArgs e) { loading.Show(); this.Children.Remove(sender as WindowBase); UserLogin userLogin = new UserLogin() { Z = 7 }; userLogin.Regist += new MouseButtonEventHandler(ShowRegist); userLogin.Login += new MouseButtonEventHandler(EnterRoleManager); userLogin.ResourceReady += (s1, e1) => { loading.Hide(); double startX = (Application.Current.Host.Content.ActualWidth - 301) / 2; double startY = (Application.Current.Host.Content.ActualHeight - 189) / 2; this.Children.Add(userLogin); userLogin.MoveTo(startX + 160, startX, startY - 120, startY, 3, new PowerEase() { EasingMode = EasingMode.EaseOut }); }; userLogin.Show(); }