Example #1
0
        private void InitializeMainWindow()
        {
            mainWindow.Loaded += delegate
            {
                if (ViewHost.ToolViews.Contains(mainWindow.PropertyGrid))
                {
                    ViewHost.BringToFront(mainWindow.PropertyGrid);
                }

                if (ViewHost.ToolViews.Contains(mainWindow.MessageWindow))
                {
                    ViewHost.BringToFront(mainWindow.MessageWindow);
                }

                if (ViewHost.ToolViews.Contains(mainWindow.ProjectExplorer))
                {
                    ViewHost.BringToFront(mainWindow.ProjectExplorer);
                }
            };

            mainWindow.Closing += delegate(object sender, CancelEventArgs e)
            {
                if (isExiting)
                {
                    return;
                }

                e.Cancel = true; // Handle exit manually
                ExitApplication();
            };
        }
Example #2
0
        public void Show()
        {
            LoadBackground();
            _content.View = View;

            foreach (Control control in Owner.Controls)
            {
                if (control.Enabled)
                {
                    control.Enabled = false;
                    _controlsToRestore.Add(control);
                }
            }

            Owner.Controls.Add(_content);
            SetLocation();
            _content.BringToFront();
        }