void ShowNotice(object sender, MouseButtonEventArgs e) { loading.Show(); this.Children.Remove(sender as WindowBase); loginTip = new LoginTip() { Z = 999999 }; this.Children.Add(loginTip); Notice notice = new Notice() { Z = 7 }; notice.Next += new MouseButtonEventHandler(ShowLogin); notice.GameStart += new MouseButtonEventHandler(GameStart); notice.ResourceReady += (s1, e1) => { loading.Hide(); double startX = (Application.Current.Host.Content.ActualWidth - 464) / 2; double startY = (Application.Current.Host.Content.ActualHeight - 423) / 2; this.Children.Add(notice); notice.MoveTo(startX + 160, startX, startY - 120, startY, 3, new PowerEase() { EasingMode = EasingMode.EaseOut }); }; notice.Show(); }
void GameStart(object sender, MouseButtonEventArgs e) { this.Children.Remove(sender as WindowBase); backgroundFirst.Dispose(backgroundFirst, null); this.Children.Remove(backgroundFirst); backgroundFirst = null; backgroundSecond.Dispose(backgroundSecond, null); this.Children.Remove(backgroundSecond); backgroundSecond = null; head.Dispose(head, null); foot.Dispose(foot, null); ClearCloud(); music.Stop(); this.Children.Remove(music); this.Children.Remove(loading); loading = null; this.Children.Remove(loginTip); loginTip = null; base.Dispose(this,null); if (Completed != null) { Completed(this, null); } }