Change text/visibility of a command/button #505
|
Hi, I need to change visibility / change the text of a button/menu command in runtime. I've found this piece of documentation: https://learn.microsoft.com/en-us/visualstudio/extensibility/changing-the-appearance-of-a-command?view=vs-2022 However, I wonder if community toolkit makes this process less painful than the official examples. Thanks in advance. |
Answered by
jamesc-skyward
Jul 16, 2024
Replies: 2 comments 2 replies
|
@pbanosdev There is some sample code in the docs here: https://learn.microsoft.com/en-us/visualstudio/extensibility/changing-the-text-of-a-menu-command?view=vs-2022 |
1 reply
|
In your Command class that inherits from BaseCommand, you should have access to the Command property: With this you should be able to change the text and visibility. |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In your Command class that inherits from BaseCommand, you should have access to the Command property:
Community.VisualStudio.Toolkit/src/toolkit/Community.VisualStudio.Toolkit.Shared/Commands/BaseCommand.cs
Line 100 in 2fac3c4
With this you should be able to change the text and visibility.