Hide unhide Primary Commands of a Content Page

Is it possible to hide or unhide some icons of the primary commands of a content page depending on whether the associated MediaCommand is defined or not? For example, for the MediaControllerTile some devices have a PowerToggle attribute and some do not, only PowerOn and PowerOff. I managed to dynamically hide or unhide the tile’s PowerToggle button and 2 buttons to PowerOn and PowerOff, but I am not able to dynamically change the PrimaryCommands Collection of the ContentPage according to whether PowerToggle, PowerOn and PowerOff are defined or not. Is it possible to do it?

In addition, is it possible to change the color of the icons of the PrimaryCommands Collection? (By the way, if using only text, the text is not shown in Windows, only in Android)

Many thanks.

PrimaryCommands cannot be hidden. The color used is the current theme’s foreground color. So in dark mode the color is white & in light mode the color is black.

Bill, ok thank you very much