Hi,
I have a requirement for the map tools which is when nothing is selected or in valid data is select due to which nothing will be shown in the map tool UI then focus should be in map. If correct data is selected which is loaded in the map tool's UI then focus should be in map tool. By focus I mean the blue line across the map tool's dockpane or embeddable control.
Can we achieve this?
i am not sure what you mean with:
"By focus I mean the blue line across the map tool's dockpane or embeddable control. "
However, in essence you would have to monitor feature selection and if your data selection conditions are useable by your tool you can then switch the current tool to your tool (or enable the tool button).
@Wolf I am talking about the below blue line around the tool.
So the requirement is if something is selected and tool is opened with that selected data then this blue line around the tool should be visible. And if nothing is selected in the map then there should not be blue line around the tool. I think we can replicate this if u open the tool and u click on the tool then this line comes across the tool makes the focus on the tool and then if you will click on the map then blue line disappears from the tool and focus is now on the map.
But now we need to implement something like this based on selection. That's why if any selection focus should be on the tool which can be shown using blue line around the tool. If no selection then no blue line and focus should be on the map.
Any idea? @Wolf
In your code where you determine whether the tool should be focused or not, you can just activate the tool via
var editCommand = FrameworkApplication.GetPlugInWrapper("esri_editing_ShowEditFeaturesBtn") as ICommand;
if (editCommand != null && editCommand.CanExecute(null))
{
editCommand.Execute(null);
}
If you need to activate the map, then you need to find its pane:
IEnumerable<IMapPane> mapPanes = FrameworkApplication.Panes.OfType<IMapPane>();
foreach (var mapPane in mapPanes)
{
if (isMyMapPane??)
{
var pane = mapPane as Pane;
pane?.Activate();
return;
}
}