private void ShowContextMenu()
        {
            _clickPoint = MouseCursorPosition.GetMouseCursorPosition();
            System.Diagnostics.Debug.WriteLine($@"MouseLocation: {_clickPoint.X} {_clickPoint.Y}");
            var contextMenu = FrameworkApplication.CreateContextMenu("DynamicMenu_DynamicFeatureSelection", () => MouseLocation);

            contextMenu.DataContext = this;
            contextMenu.Closed     += (o, e) =>
            {
                // clear the list asynchronously
                lock (LockSelection)
                {
                    Selection.Clear();
                }
            };
            contextMenu.IsOpen = true;
        }
Esempio n. 2
0
        void OnFeatureSelected(BasicFeatureLayer layer, long oid)
        {
            var mapView = MapView.Active;

            mapView?.FlashFeature(layer, oid);
            Thread.Sleep(1000);
            mapView?.FlashFeature(layer, oid);
            System.Windows.Point mousePnt = MouseCursorPosition.GetMouseCursorPosition();
            var popupDef = new PopupDefinition()
            {
                Append   = true,                             // if true new record is appended to existing (if any)
                Dockable = true,                             // if true popup is dockable - if false Append is not applicable
                Position = mousePnt,                         // Position of top left corner of the popup (in pixels)
                Size     = new System.Windows.Size(200, 400) // size of the popup (in pixels)
            };

            //Show pop-up of feature
            mapView?.ShowPopup(layer, oid, popupDef);
        }