I was working on updating our older app to Arcgis Pro 3.3.
The code is set of AddIns which are added to Arcgis Pro. Its set of like 10 addins. Across the whole solution, FrameworkApplication.SetCurrentToolAsync is widely used and it works correctly in all addins apart from one.
The implementation is extactly the same, but when I activate the tool using "FrameworkApplication.SetCurrentToolAsync" it will not activate. I jave no idea why.
Usage:
await FrameworkApplication.SetCurrentToolAsync("ArcGISPro_SD_TiskoveVystupy_PolygonSelector");
Config.daml:
<tool id="ArcGISPro_SD_TiskoveVystupy_PolygonSelector" caption="PolygonSelector" className="PolygonSelector" loadOnClick="true" smallImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonRed16.png" largeImage="pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericButtonRed32.png" condition="esri_mapping_mapPane">
<tooltip heading="Tooltip Heading">
Tooltip text<disabledText /></tooltip>
</tool>
ClassName:
internal class PolygonSelector : MapTool
{
public PolygonSelector() : base()
{
IsSketchTool = true;
SketchType = SketchGeometryType.Rectangle;
SketchOutputMode = SketchOutputMode.Map;
}
protected override Task OnToolDeactivateAsync(bool hasMapViewChanged)
{
return base.OnToolDeactivateAsync(hasMapViewChanged);
}
protected override Task OnToolActivateAsync(bool active)
{
return base.OnToolActivateAsync(active);
}
protected override async Task<bool> OnSketchCompleteAsync(Geometry geometry)
{
return true;
}
}
It will never jump to OnToolActivatingAsync and therefore no to OnSketchCompleteAsync. It will jump there only when I am activating another one, it will jump to OnActvating, right afetr that to Deactivating and the new tools does not jump to Activate once again.
Like I said, in other addins this works, here no, I am not sure what to look for and what could be the issue.