/// <summary> /// 默认函数 /// </summary> /// <param name="parentWindow">父窗口</param> /// <param name="message">显示的内容</param> public Waiting(Window parentWindow, string message) { InitializeComponent(); this.ShowInTaskbar = false; if (parentWindow == null) { parentWindow = Application.Current.MainWindow; } this.Owner = parentWindow; this.WindowStartupLocation = WindowStartupLocation.CenterOwner; //this.ProgressBar1.Content = message; this.Width = parentWindow.ActualWidth; this.Height = parentWindow.ActualHeight; //top = parentWindow.Top; //left = parentWindow.Left; RECT rect = WindowApi.GetInstance().GetWindowLocation(parentWindow.Title); top = rect.Top; left = rect.Left; this.Loaded += Waiting_Loaded; }