/// <summary> /// This event is called, when the user released the mouse button in ArcMap. /// </summary> /// <param name="arg">Event arguments</param> protected override void OnMouseUp(MouseEventArgs arg) { try { ArcmapPick pick = LazyLoadPickTool(); ArcmapPickCandidate pickedCandidate = pick.OnMouseUp(arg.X, arg.Y); if (pickedCandidate != null) { ArcmapUtils.FlashFeature(pickedCandidate.Feature, ArcmapUtils.FocusMapToScreenDisplay(pick.FocusMap)); GeometrySpyViewModel viewModel = new GeometrySpyViewModel(pickedCandidate.Feature); GeometrySpyView form = new GeometrySpyView(); form.SetDataContext(viewModel); WindowsUtils.MakeModelessDialogParentOf(form, new IntPtr(ArcMap.Application.hWnd)); form.Show(); } } catch (Exception) { // Don't let the exeption escape to arcgis. ResetPickTool(); } ArcmapUtils.InvalidateMap(ArcmapUtils.GetFocusMap()); }
public void SetDataContext(GeometrySpyViewModel viewModel) { ((ApplicationSpyViewWpf)wpfHost.Child).DataContext = viewModel; }