Hey experts,
I'm new to WPF. Currently I have task need to do some customization for RibbonGroup.
May I know is that any way that I can add Image beside the RibbonGroup name like the Orange star in the picture below?
Please guide me if this is possible to do or Infragistic is not supporting to that customization.
Thank you very much!
Hi Peai Chun,
In order to achieve this, you will need to modify the whole template for the RibbonGroup. You can find the template definition in the following file:
C:\Program Files (x86)\Infragistics\2017.2\WPF\DefaultStyles\Ribbon\RibbonGeneric.xaml
I have also attached a sample that demonstrates how you can accomplish this. In the CustomRibbonGroup.xaml file in my sample, I have made the following modifications to the default template we provide:
<!-- Image Modification --> <!--<TextBlock x:Name="PART_Caption" Text="{TemplateBinding Caption, Converter={StaticResource stringWithoutMnemonicsConverter}}" Grid.Row="1" Margin="5,0,5,3" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" TextTrimming="CharacterEllipsis" igWindows:ClippedTextToolTipService.ShowToolTipWhenClipped="True" igWindows:ClippedTextToolTipService.ToolTipStyleKey="{x:Static igRibbon:XamRibbon.ToolTipStyleKey}" TextAlignment="Center" Foreground="{DynamicResource {x:Static igRibbon:RibbonBrushKeys.RibbonGroupCaptionTextFillKey}}" />--> <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="5,0,5,3" VerticalAlignment="Bottom" HorizontalAlignment="Center"> <TextBlock x:Name="PART_Caption" Text="{TemplateBinding Caption, Converter={StaticResource stringWithoutMnemonicsConverter}}" TextTrimming="CharacterEllipsis" igWindows:ClippedTextToolTipService.ShowToolTipWhenClipped="True" igWindows:ClippedTextToolTipService.ToolTipStyleKey="{x:Static igRibbon:XamRibbon.ToolTipStyleKey}" Foreground="{DynamicResource {x:Static igRibbon:RibbonBrushKeys.RibbonGroupCaptionTextFillKey}}" /> <Image Height="16px" Width="16px" Source="Images\igdt_folder_open.gif"></Image> </StackPanel> <!-- End Image Modification -->
3056.XamRibbon_GroupImage.zip
If you need any further assistance with this, please let me know and I will be glad to help.
Hello Peai Chun,
Thank you for posting in our forums!
I am investigating how this may be achieved for you and need a little more time to research this.
I will have more information or questions for you tomorrow.