最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

.net 8.0 - ArcGis - FrameworkApplication.SetCurrentToolAsync does not activate tool - Stack Overflow

programmeradmin2浏览0评论

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.

发布评论

评论列表(0)

  1. 暂无评论