'How to set up a category (in code) that shows an action in the menu and on the toolbar? (XAF)

In my xaf .net6 winforms project I can set up an action to appear on the context menu by setting it's Category to "Menu"

using a predefined category

The docs explain that the "Menu" category will cause the action to appear on the context menu.

However I want the action on both the context menu and the toolbar.

Is there a way to do that in code without editing the xafml?

It occurs to me that I could simply duplicate each action but I am wondering if there is a better way.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source