Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
Backstage
As per Chris Meyer post.
I have a button called SAVEITEM:
Colin
I have a button called SAVEITEM:
<Button Key="BUTTON_SAVEITEM">
<Command Key="SAVEITEM"
Caption="Save Item"
KeyboardTip=""
Tooltip="Save Item displayed"
Shortcut="Ctrl+S"
LargeIcon=".\Bmps\RibbonItemSave.png"
/>
</Button>
And a Backstage called:<Button>
<Command Key="MAIN_SAVE_ITEM"
Caption="Save Item"
KeyboardTip=""
Tooltip=""
Shortcut="Ctrl+S"
LargeIcon=""
SmallIcon=".\Bmps\RibbonItemSave16.png" />
</Button>
I would prefer to have the Command for the Backstage the same as the button, but enabling/disabling using the command key seems to only work on one... unless I am doing something wrong.Colin
Comments
<Button Key="BUTTON_SAVEITEM"> <Command Key="SAVEITEM" Caption="Save Item" KeyboardTip="" Tooltip="Save Item displayed" Shortcut="Ctrl+S" LargeIcon=".\Bmps\RibbonItemSave.png" /> </Button> <Button Key="BACKSTAGE_SAVEITEM" Command="SAVEITEM" />
Whenever a command is "spotted" in the XML, it becomes available to reference anywhere else below that. So, assuming you are creating the backstage button second, you should be able to just point the backstage button to the SAVEITEM command created earlier.This then shows up another issue, in that the backstage button is the large one, even if I add SmallIcon to the backstage.
I have used the small icons as there seems to be no way to spread the large icons out.
<Button Key="BUTTON_SAVEITEM"> <Command Key="SAVEITEM" Caption="Save Item" KeyboardTip="" Tooltip="Save Item displayed" Shortcut="Ctrl+S" LargeIcon=".\Bmps\RibbonItemSave.png" /> SmallIcon=".\Bmps\RibbonItemSaveSmall.png" /> </Button> <Button Key="BACKSTAGE_SAVEITEM" Command="SAVEITEM" />
That being said, I need to update the wiki to make it clear that any commands associated to backstage buttons must have a SmallIcon in order to appear properly.I presumed this would display the appropriate button icons in the places where used.
But, at your suggestion, I added both LargeIcon and SmallIcon to the Home command, and this then causes the SmallIcon to display properly in the Backstage.
All now OK, thanks.