private void CloseControllerNotFound() { if (controllerNotFound != null) { this.Dispatcher.Invoke((Action)delegate { controllerNotFound.Close(); }); controllerNotFound = null; this.iEventAggregator.GetEvent<PubSubEvent<ViewEventArgs>>().Publish(new ViewEventArgs("CONTROLLER_NOTFOUND_CLOSE", new string[] { })); } }
private void OpenControllerNotFound() { if (controllerNotFound == null) { //MaximizeShell(); this.iEventAggregator.GetEvent<PubSubEvent<ViewEventArgs>>().Publish(new ViewEventArgs("CONTROLLER_NOTFOUND_OPEN", new string[] { })); //for shade this.Dispatcher.Invoke((Action)delegate { this.Activate(); controllerNotFound = new ControllerNotFound(); controllerNotFound.ShowInTaskbar = false; controllerNotFound.Owner = Application.Current.MainWindow; controllerNotFound.Topmost = true; while (!controllerNotFound.IsVisible) { controllerNotFound.Show(); //controllerNotFound.MaxHeight = Application.Current.MainWindow.ActualHeight - 100; //controllerNotFound.MaxWidth = Application.Current.MainWindow.ActualWidth - 120; //controllerNotFound.Left = (Application.Current.MainWindow.ActualWidth - controllerNotFound.Width) / 2; //controllerNotFound.Top = (Application.Current.MainWindow.ActualHeight - controllerNotFound.Height) / 2; } }); } }