Skip to content

Commit 9fe3fc8

Browse files
committed
massaged page to closer inline with tone and style
1 parent 8121027 commit 9fe3fc8

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

hub/powertoys/command-palette/add-top-level-commands-to-your-extension.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,24 +56,23 @@ public <ExtensionName>CommandsProvider()
5656
```
5757

5858
> [!NOTE]
59-
> `ShowMessageCommand()` section was created prior at [InvokableCommand Command](adding-commands#invokableCommand-command)
59+
> The `ShowMessageCommand()` functionality was created prior at [InvokableCommand Command](adding-commands#invokableCommand-command)
6060
6161
1. Deploy your extension
6262
1. In command palette, `Reload`
6363

6464
![Screenshot of extension with send message command at top level](../../images/command-palette/top-level-command.png)
6565

66-
There you have it. Now you can add additional top-level commands to your extension.
67-
68-
66+
Now there is an additional top-level commands to your extension.
6967

68+
## Add top level command dynamically
7069

7170
If you'd like to update the list of top-level commands dynamically, you can do so in the same way as you would update a list page. This can be useful for cases like an extension that might first require the user to log in, before showing certain commands. In that case, you can show the "log in" command at the top level initially. Then, once the user logs in successfully, you can update the list of top-level commands to include the commands that required authentication.
7271

73-
Once you've determined that you need to change the top level list, call [RaiseItemsChanged](./microsoft-commandpalette-extensions-toolkit/commandprovider_raiseitemschanged.md) on your **CommandProvider**. Command Palette will then request the top-level commands via **TopLevelCommands** again, and you can return the updated list.
72+
Once you've determined that you need to change the top level list, call [RaiseItemsChanged](./microsoft-commandpalette-extensions-toolkit/commandprovider_raiseitemschanged.md) on your `CommandProvider`. Command Palette will then request the top-level commands via **TopLevelCommands** again, and you can return the updated list.
7473

7574
> [!TIP]
76-
> Create the **CommandItem** objects for the top-level commands before calling **RaiseItemsChanged**. This will ensure that the new commands are available when Command Palette requests the top-level commands. This will ensure that the work being executed in each call to **TopLevelCommands** method to a minimum.
75+
> Create the `CommandItem` objects for the top-level commands before calling `RaiseItemsChanged`. This will ensure that the new commands are available when Command Palette requests the top-level commands. This will ensure that the work being executed in each call to **TopLevelCommands** method to a minimum.
7776
7877
### Next up: [Command Results](command-results.md)
7978

0 commit comments

Comments
 (0)