RibbonGallery ItemTemplate Overlap issues

Ribbon for WPF Forum

Posted 4 years ago by Michel Chami - Software Engineer, Safe Engineering Services & technologies ltd.
Version: 14.2.0610
Avatar

I am trying to use the RibbonGallery with the ItemTemplate containing 4 TextBlock with bound strings.

When the font size changes or the language, the gallery items tend to overlap.

It seems the next gallery item is starting before the end of the previous one.

 

Here is my example:

<ribbon:Group Label="{Resx ResxName=SES.Modules.XxtrWPF.RibbonView, Key=rgbXSTab_FaxGroup_Header}" MinWidth="50" FontSize="{Binding Source={x:Static infTools:XxtrTools.SharedSettings}, Path=FontSize, Mode=OneWay}">

<ribbon:RibbonGallery ItemsSource ="{Binding Path=CurrentXS.Faxs, Mode=TwoWay}" VariantBehavior="Default" VariantSize="Small">

<ribbon:RibbonGallery.ItemTemplate > <DataTemplate> <Border Name="FaxGalleryBorder" BorderBrush="#C0C0C0" BorderThickness="2" MinWidth="160" MaxWidth="400"> <StackPanel Margin="4">

<StackPanel Orientation="Horizontal"> <TextBlock Text="{Resx ResxName=SES.Modules.XxtrWPF.RibbonView, Key=lblFaxNumber_Content}"/> <TextBlock Text="{Binding Path=Index, Mode=TwoWay}"/> </StackPanel>

<StackPanel Orientation="Horizontal"> <TextBlock Text="{Resx ResxName=SES.Modules.XxtrWPF.RibbonView, Key=lblFaxName_Content}"/> <TextBlock Text="{Binding Path=Name, Mode=TwoWay}" TextTrimming="CharacterEllipsis"/> </StackPanel>

</StackPanel> </Border> </DataTemplate> </ribbon:RibbonGallery.ItemTemplate> </ribbon:RibbonGallery> </ribbon:Group>

[Modified 4 years ago]

Comments (1)

Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Michel,

The gallery items need to be a fixed size and all the same size to work properly.  Make sure you either use TextWrapping or TextTrimming on your TextBlock and set a fixed size (Width/Height) on the containers in the item template instead of MinWidth/MaxWidth.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.