Width of ribbon group is calculated incorrectly on startup

Ribbon for WPF Forum

Posted 3 years ago by Patrick Neubauer
Version: 21.1.1
Platform: .NET 4.8
Environment: Windows 10 (64-bit)

Hi there,

we currently got the problem that some ribbon groups are not rendered correctly. We use the ItemVariantBehavior of 'MediumThenSmallWhenSmall'. The width is the medium one but the icons are rendered as small ones.
This problem only occurs on the startup of the application. If we decrease or increase the size of the application that the ribbon will be rerendered then everything is working fine.

There seems to be a problem with the calculation of the ribbon group size. This problem is dependent on the length of the button label. If we change the language then the problem disappears.

Sample code of a ribbon group where the problem occurs:

    d:DataContext="{d:DesignInstance Type={x:Type viewModels:RibbonViewModelBase}}"
    ImageSourceSmall="{Binding Converter={phx:GetImageSourceFromImageLibraryConverter}, ConverterParameter=Border16}"

    <ribbon:StackPanel ItemVariantBehavior="MediumThenSmallWhenSmall">
            Command="{Binding GlobalDeleteDefaultControlViewModel.GlobalDeleteCommand}"
            IsChecked="{Binding GlobalDeleteDefaultControlViewModel.IsGlobalDeleteActive}" />
            Command="{Binding GlobalDeleteDefaultControlViewModel.GlobalDefaultControlDataCommand}"
            IsChecked="{Binding GlobalDeleteDefaultControlViewModel.IsGlobalDefaultControlDataActive}" />
            Command="{Binding DrawingSelectionControlViewModel.DrawEscCommand}"
            Focusable="False" />


Is there something we can to trigger a rerendering as a workaround? Or is there something wrong with the code?
If you need a screenshot of the problem please contact me.

Best regards

Patrick Neubauer

[Modified 3 years ago]

Comments (2)

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

Hi Patrick,

The best thing would be for you to put together a new simple sample project that shows the issue occurring.  Keep it as minimal as possible with the fewest elements needed to reproduce the situation.  Then we can debug with that and see what's going on.  Send that to our support address and reference this thread in your e-mail.  Be sure to exclude the bin/obj folders from the .zip you send so it doesn't get spam blocked.  Thanks!

Actipro Software Support

Posted 3 years ago by Patrick Neubauer

Hi there,

we could fix the problem by using the priority feature of the GroupVariant.

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.