Expose Index Property in ConsoleMenu.Add #27
Sophtware-com
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, each MenuItem in ConsoleMenu supports an Index property, which is useful for ordering or referencing items explicitly. However, the Add method on ConsoleMenu does not expose this property, making it impossible to set the index directly when adding items through that method.
It would be a simple and valuable enhancement to bubble up the Index property into the Add method signature. This would allow developers to set the index inline without needing to construct and add MenuItem objects manually.
Would love to see this added—it would improve flexibility and reduce boilerplate for more dynamic menu scenarios.
The motivation behind this is to number the menu items from 1 to XX and reserve 0 for the Exit command. That way Exit is consistent on every menu. Right now, the Exit option is always the last index number and not user friendly.
Beta Was this translation helpful? Give feedback.
All reactions