Hi,
since the version 2016.1.630, the icons in the backstage buttons are missing, you can see this in the Ribbon demo Document Editor.
Hi,
since the version 2016.1.630, the icons in the backstage buttons are missing, you can see this in the Ribbon demo Document Editor.
Hello, do you mean the backstage buttons like Options and Exit Sample on the Backstage. If so, yes that is true... we updated the template for those to render similar to the latest Office version.
[Modified 9 years ago]
So, is there a way to get the icons back into the buttons of the backstage (either small or large)?
Hi Adam,
I'm sorry but no, the Image isn't part of the template for that usage scenario any more. You could make a custom template that has the Image in it and apply that to the buttons. Here's the template that gets applied right now. You could put an image next to the TextBlock in a clone of this an reference the updated template for your instances.
<ControlTemplate x:Key="BackstageHeaderButtonTemplate" TargetType="{x:Type ribbonControlsPrimitives:ButtonBase}">
<Border Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" SnapsToDevicePixels="True">
<Border x:Name="innerBorder" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
<shared:PixelSnapper Margin="{TemplateBinding Padding}">
<TextBlock x:Name="label" FontSize="13" Text="{TemplateBinding Label}" Foreground="{TemplateBinding Foreground}" VerticalAlignment="Center" SnapsToDevicePixels="True" />
</shared:PixelSnapper>
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemBackgroundHoverBrushKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemBorderHoverBrushKey}}" />
<Setter TargetName="innerBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemInnerBorderHoverBrushKey}}" />
<Setter TargetName="label" Property="TextElement.Foreground" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemForegroundHoverBrushKey}}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemBackgroundSelectedBrushKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemBorderSelectedBrushKey}}" />
<Setter TargetName="innerBorder" Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemHighlightSelectedBrushKey}}" />
<Setter TargetName="innerBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemInnerBorderSelectedBrushKey}}" />
<Setter TargetName="label" Property="TextElement.Foreground" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemForegroundSelectedBrushKey}}" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemBackgroundSelectedBrushKey}}" />
<Setter Property="BorderBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemBorderSelectedBrushKey}}" />
<Setter TargetName="innerBorder" Property="Background" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemHighlightSelectedBrushKey}}" />
<Setter TargetName="innerBorder" Property="BorderBrush" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemInnerBorderSelectedBrushKey}}" />
<Setter TargetName="label" Property="TextElement.Foreground" Value="{DynamicResource {x:Static themes:AssetResourceKeys.BackstageTabItemForegroundSelectedBrushKey}}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="label" Property="Opacity" Value="0.4"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
That works. My only concern is for updates to ribbon template that are breaking changes. I couldn't figure out how to extract the template like I normally do through the Document Outline pane. Can you please explain how you got the template so I can document it so the next developer that updates the ribbon will know how to do it.
Thanks.
Hi Adam,
Template extraction via external tools is never reliable. If your company has a WPF Studio suite license, you can download the default styles/templates from your organization account page. Otherwise, if you have licensed the product individually, you'd have to request the default styles/templates from us for manual download. You'd only have to refresh it if you need it to look different within your app.
Please log in to a validated account to post comments.