private void MapPoint_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e) { ParcelLineInfoWindow.IsOpen = false; if (DPE_ParcelEntry.IsExpanded || (!PDE_Tools.IsExpanded && !PDE_Find.IsExpanded && !PDE_Share.IsExpanded)) { ParcelTool(e.MapPoint); } else if (PDE_Tools.IsExpanded) { if (_originPoint == null) { ParcelTool(e.MapPoint); } // Sometimes we don't get the mouse up event? Ensure its released now. _srPoint = null; } else if (PDE_Find.IsExpanded) { bool create = _identifyDialog == null || !_identifyDialog.IsLoaded; if (create) { _identifyDialog = new IdentifyWindow(); } double dialogWidth = _identifyDialog.Width; // If dialog is new, capture size double dialogHeight = _identifyDialog.Height; // before its shown. if (create) { _identifyDialog.Owner = this; _identifyDialog.Show(); } _identifyDialog.Visibility = System.Windows.Visibility.Hidden; _identifyDialog.IdentifyPoint(ParcelMap, ref _xmlConfiguation, e.MapPoint); int offset = 10; // Hard coded offset so we don't position the window exactly where the cursor is double top = e.ScreenPoint.Y + this.Top + SystemParameters.ResizeFrameVerticalBorderWidth + SystemParameters.CaptionHeight + offset; double left = e.ScreenPoint.X + this.Left + SystemParameters.ResizeFrameVerticalBorderWidth + offset; // Keep the window in the virtual screen bounds double screenWidth = System.Windows.SystemParameters.VirtualScreenWidth; double screenHeight = System.Windows.SystemParameters.VirtualScreenHeight; if (left + dialogWidth > screenWidth) { left = screenWidth - dialogWidth; } if (top + dialogHeight > screenHeight) { top = screenHeight - dialogHeight; } _identifyDialog.Top = top; _identifyDialog.Left = left; } }
private void MapPoint_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e) { ParcelLineInfoWindow.IsOpen = false; if (DPE_ParcelEntry.IsExpanded || (!PDE_Tools.IsExpanded && !PDE_Find.IsExpanded && !PDE_Share.IsExpanded)) ParcelTool(e.MapPoint); else if (PDE_Tools.IsExpanded) { if (_originPoint == null) ParcelTool(e.MapPoint); // Sometimes we don't get the mouse up event? Ensure its released now. _srPoint = null; } else if (PDE_Find.IsExpanded) { bool create = _identifyDialog == null || !_identifyDialog.IsLoaded; if (create) _identifyDialog = new IdentifyWindow(); double dialogWidth = _identifyDialog.Width; // If dialog is new, capture size double dialogHeight = _identifyDialog.Height; // before its shown. if (create) { _identifyDialog.Owner = this; _identifyDialog.Show(); } _identifyDialog.Visibility = System.Windows.Visibility.Hidden; _identifyDialog.IdentifyPoint(ParcelMap, ref _xmlConfiguation, e.MapPoint); int offset = 10; // Hard coded offset so we don't position the window exactly where the cursor is double top = e.ScreenPoint.Y + this.Top + SystemParameters.ResizeFrameVerticalBorderWidth + SystemParameters.CaptionHeight + offset; double left = e.ScreenPoint.X + this.Left + SystemParameters.ResizeFrameVerticalBorderWidth + offset; // Keep the window in the virtual screen bounds double screenWidth = System.Windows.SystemParameters.VirtualScreenWidth; double screenHeight = System.Windows.SystemParameters.VirtualScreenHeight; if (left + dialogWidth > screenWidth) left = screenWidth - dialogWidth; if (top + dialogHeight > screenHeight) top = screenHeight - dialogHeight; _identifyDialog.Top = top; _identifyDialog.Left = left; } }