void PageChange(object sender, RoutedEventArgs e) { if (e.OriginalSource.ToString().Equals("PipeNetManager.Login.LoginWnd")) { LoadWait wait = new LoadWait(); this.stackpanl.Children.Clear(); this.stackpanl.Children.Add(wait); } else if (e.OriginalSource.ToString().Equals("PipeNetManager.eMap.Mapctl")) { this.Grid1.Children.Remove(textBlock1); //移除textblock Mapctl eMap = e.OriginalSource as Mapctl; eMap.AddContent(); eMap.setCallBack(new LocaleCallBack(this)); this.Grid1.Children.Remove(textBlock1); //移除textblock this.stackpanl.Children.Clear(); this.stackpanl.HorizontalAlignment = System.Windows.HorizontalAlignment.Left; this.stackpanl.VerticalAlignment = System.Windows.VerticalAlignment.Top; this.stackpanl.Children.Add(eMap); } }
public LoadWait() { InitializeComponent(); mMap = new Mapctl(); Dowork(); }