Width of ribbon group is calculated incorrectly on startup

Ribbon for WPF Forum

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

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:

<ribbon:Group
    x:Class="Ribbon.SubControls.RibbonDrawingEscGroup"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:phx="http://PhoenixNamespaceSchema.com"
    xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
    xmlns:viewModels="clr-namespace:MainWindow.ViewModel.Ribbon"
    Uid="DrawingModifyTools"
    d:DataContext="{d:DesignInstance Type={x:Type viewModels:RibbonViewModelBase}}"
    d:DesignHeight="450"
    d:DesignWidth="800"
    ImageSourceSmall="{Binding Converter={phx:GetImageSourceFromImageLibraryConverter}, ConverterParameter=Border16}"
    IsCollapsible="False"
    Label=""
    mc:Ignorable="d">

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

</ribbon:Group>

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 30 days ago]

Comments (2)

Posted 29 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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 29 days ago by Patrick Neubauer
Avatar

Hi there,

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

The latest build of this product (v21.1.2) was released 19 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.