Jamie Garroch (MVP)
asked on
Adding clickable images in the Office backstage fluent UI XML
I'd like to be able to add a new tab to the PowerPoint backstage and within that tab, add groups/containers to built a custom UI to select thumbnails of PowerPoint templates. I'd like to reproduce something close to the File / New tab view that shows multiple template thumbnails:
However, after a lot of digging in the backstage model, I can only find the following controls that support [decent sized] images:
However, after a lot of digging in the backstage model, I can only find the following controls that support [decent sized] images:
<imageControl> problem : doesn't support onAction callback
<task> problem : at the largest size, the image attribute sets an icon at a fixed 64x64 pixels
Is there a way round this to show a "gallery" of clickable images other than having a text based dropdown that when clicked, sets the preview image for the current template? Microsoft state that the gallery control is available in the backstage in this MSDN article but after my digging, it's actually only in the contextMenus section so this appears all I have access to:ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
AFAIK the only size options are large, normal and borderless. Large is 32x32.
I can see that isn't really going to do what you need but it's my best shot at the moment
As an aside do you have a decent xml editor in visual studio with intellisense? I can maybe talk you through this privately if not.
I can see that isn't really going to do what you need but it's my best shot at the moment
As an aside do you have a decent xml editor in visual studio with intellisense? I can maybe talk you through this privately if not.
ASKER
Thanks JSRWilson for confirming that custom-sized images with inAction callbacks are not supported in the backstage.
ASKER
I found an answer JSRWilson. The Hyperlink control renders its image element at the size one creates the image and supports the onAction callback:
So this is how it renders my 202 x 115 px slideThumb JPG image:
Notes:
1. The target and onAction attributes are mutually exclusive.
2. The label attribute doesn't appear to render if an image attribute is specified :-(
3. The isDefinitive attribute is not supported by this element :-(
4. The callback signature for the hyperlink element is incorrectly stated in this MSDN article as Sub OnAction(control As IRibbonControl, itemID As String, itemIndex As Integer)
<hyperlink id="hyperlink1"
label="Hyperlink label"
onAction="OnAction"
image="slideThumb"
screentip="Hyperlink screentip"
supertip="Hyperlink supertip"/>
So this is how it renders my 202 x 115 px slideThumb JPG image:
Notes:
1. The target and onAction attributes are mutually exclusive.
2. The label attribute doesn't appear to render if an image attribute is specified :-(
3. The isDefinitive attribute is not supported by this element :-(
4. The callback signature for the hyperlink element is incorrectly stated in this MSDN article as Sub OnAction(control As IRibbonControl, itemID As String, itemIndex As Integer)
Good find. I confirmed all of your comments (labels) Still a useful technique though. I'm meeting the PowerPoint code team in Seattle in November. If I have time I'll ask what can be done / file a bug.
ASKER
And this is how your XML snippet renders the image to 32 x 32 px:
So are you confirming that there is no way to render an image in the backstage with custom dimensions with an onAction callback as per my 202 x 115 example?