Thanks for the reply, @CharlesMacleod. The tool activation is done from custom code, not from Pro buttons.
I have changed approach and am now attempting to activate 2 separate tools from each other's HandleKeyDownAsync methods (aka DrawFireMapTool activates DrawTargetMapTool and vice versa).
I have put breakpoints into OnToolDeactivateAsync and see that it is not being called on the 1st tool when the 1st tool activates the 2nd tool. So I am assuming this approach won't work either?
How does the palette switch tools? Can I deactivate a tool from within itself?
// DrawFireMapTool.cs
protected override async Task HandleKeyDownAsync(MapViewKeyEventArgs args)
{
if (args.Key == System.Windows.Input.Key.LeftCtrl)
{
// activate Target tool
await FrameworkApplication.SetCurrentToolAsync(DrawTargetMapTool.DamlId);
}
else
{
await base.HandleKeyDownAsync(args);
}
}
// DrawTargetMapTool.cs
protected override async Task HandleKeyUpAsync(MapViewKeyEventArgs args)
{
if (args.Key == System.Windows.Input.Key.LeftCtrl)
{
// activate Fire tool
await FrameworkApplication.SetCurrentToolAsync(DrawFireMapTool.DamlId);
}
else
{
await base.HandleKeyUpAsync(args);
}
}