/// <summary> /// Display the pan window on the mouse down. /// </summary> private void PanPanelMouseDownHandler(object sender, MouseEventArgs e) { var diagram = CurrentDiagram as EntityDesignerDiagram; if (diagram == null) { return; } // store off whether we are showing the grid var showingGrid = diagram.ShowGrid; // turn off the grid before we build our thumbnail // (without this, VS hangs while generating the thumbnail) diagram.ShowGrid = false; // we pass the parent Panel control so that the thumbnail view centers on it using (var thumbnailViewForm = new ThumbnailViewForm(((Control)sender).Parent, CurrentDesigner.DiagramClientView)) { thumbnailViewForm.ShowDialog(); } // restore the original setting diagram.ShowGrid = showingGrid; }