Enable adding external tools to the External Tools menu #2965
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of the pull request
Previously, we were just adding each external tool to the toolbar. Per spec, we're now adding them to the ExternalTools menu as well.
As part of this, there was some refactoring of the ExternalTool and WindowHelper classes to get the different image formats required for both the toolbar and the menu without duplicating code. Also, as you can't databind to MenuFlyoutItem, and the ExternalTool icon image is generated asynchronously, we're handling the PropertyChanged event in code, so we can update the icon when it gets set.
Also implemented unregistering an ExternalTool from either the bar button or the menuitem for the tool.
Implemented the ExternalTools button Click handler to open the Settings UI and navigate to the Additional Tools section. As part of this, added 2 derived NavLink types, as their usage in Settings and in the ExpandedView are sufficiently different, and updated the SettingsToolWindow to match. Because we can open Settings without the ExpandedView, I've reinstated the original behavior of closing all open child windows when the Bar window closes (right now, this is just the settings window).
Unrelated fixes: