private void OpenDiagnosticsWindow()
        {
            CloseDiagnosticsWindow();

            _diagnosticsWindow          = new DiagnosticsWindow(_lastShownDXViewportView);
            _diagnosticsWindow.Closing += delegate(object o, CancelEventArgs args)
            {
                _diagnosticsWindow = null;
            };

            // Position DiagnosticsWindow to the top-left corner of our window
            double left    = this.Left + this.ActualWidth;
            double maxLeft = left + DiagnosticsWindow.InitialWindowWidth;

            if (maxLeft > SystemParameters.VirtualScreenWidth)
            {
                if (this.Left > DiagnosticsWindow.InitialWindowWidth)
                {
                    left = this.Left - DiagnosticsWindow.InitialWindowWidth;
                }
                else
                {
                    left -= (maxLeft - SystemParameters.VirtualScreenWidth);
                }
            }

            _diagnosticsWindow.Left = left;
            _diagnosticsWindow.Top  = this.Top;

            _diagnosticsWindow.Show();
        }
        private void OpenDiagnosticsView()
        {
            DiagnosticsWindow    view  = new DiagnosticsWindow();
            DiagnosticsViewModel model = new DiagnosticsViewModel();

            view.DataContext = model;
            view.Show();
        }
        private void ShowDiagnosticsWindow()
        {
            if (this.diagnosticsWindow != null && this.diagnosticsWindow.IsVisible)
            {
                return;
            }
            else
            {
                this.diagnosticsWindow = new DiagnosticsWindow();
            }

            Application application = Application.Current as Application;

            application?.CancelAutoExit();
            this.diagnosticsWindow.Show();
        }
Beispiel #4
0
 protected void ShowDiagnosticsResult(string title, string message, bool hasError, IReadOnlyCollection <Diagnostic> diagnostics)
 {
     if (diagnostics.Count > 0)
     {
         var vm = new DiagnosticsWindowViewModel()
         {
             Title       = title,
             Message     = message,
             Diagnostics = new System.Collections.ObjectModel.ObservableCollection <Diagnostic>(diagnostics)
         };
         var window = new DiagnosticsWindow()
         {
             DataContext = vm
         };
         window.ShowDialog(this);
     }
     else
     {
         MessageBox.Show(this, message, title, MessageBoxButtons.OK, hasError ? MessageBoxIcon.Error : MessageBoxIcon.Information);
     }
 }