Ribbonbar items shown as small when there is room enough

Ribbon for WPF Forum

Posted 8 years ago by Arthur Damen
Version: 11.2.0551
Avatar
Hi,

When I start my application i see that some items in a groups are displayed as small items. But there is room enough at the end of the ribbonbar to show them as normal.

When i resize (width) the application at a certain point the groups items are shown as normal. But then the empty space at the end of the ribbonbar is about 200-300 pixels.

What could be causing this behaviour?
I have groups that are invisible in this ribbonbar.

Comments (6)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Arthur,

Yes, it's probably your invisible groups that are causing it. Per Microsoft's specs you aren't really supposed to do that. Perhaps instead you could make separate class instances for your tab and have different variations of the tab that you swap in at app startup based on your criteria.


Actipro Software Support

Posted 8 years ago by Arthur Damen
Avatar
Maybe i had to say they are collapsed in stead of invisible.

When I start the application i can start in 2 modes and mode 1 does never use a certain group. This is not rocketscience. But this complete groups has to disappear in that certain condition and is never used.

Why building 2 home tabs with the same content with exception of only 1 item???
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Arthur,

Ribbon has to do some complex measurements on groups to build up a table of variants sizes, so that ribbon knows when to change variants and mimic the rich resizing functionality found in office. At the moment that code doesn't look for collapsed groups and I believe is probably measuring them the same way as normal visible ones.

If you'd like us to enhance this to support that scenario then please make a new simple sample project that shows the issue and email it to our support address. We will use it to debug with to ensure code updates fix the problem. Rename the .zip file extension so it doesn't get spam blocked.


Actipro Software Support

Posted 8 years ago by Arthur Damen
Avatar
Example which shows the problem:
The outcome is that the width of the invisible area is calculated as being used.
When you resize the window, it still includes the invisible area....

Xaml window:

<rib:RibbonWindow x:Class="MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:rib="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
    Title="MainWindow" Height="350" Width="525">
  <Grid>
    <rib:Ribbon>
      <rib:Ribbon.Tabs>
        <rib:Tab>
          <rib:Group Label="Group1">
            <rib:Button Label="AAAAAA"></rib:Button>
          </rib:Group>

          <rib:Group Name="HiddenGroup" Label="Group2" >
            <rib:Button Label="BBBBBBBDHDJSHDKHSKJD"></rib:Button>
          </rib:Group>

          <rib:Group Label="Group2">
            <rib:Button Label="BBBBBBBDHDJSHDKHSKJD"></rib:Button>
          </rib:Group>

          <rib:Group Label="Group2">
            <rib:Button Label="BBBBBBBDHDJSHDKHSKJD"></rib:Button>
          </rib:Group>

        </rib:Tab>

      </rib:Ribbon.Tabs>
    </rib:Ribbon>
  </Grid>
</rib:RibbonWindow>
Code behind:

  Private Sub MainWindow_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles Me.Loaded
    HiddenGroup.Visibility = Windows.Visibility.Collapsed
  End Sub
Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Arthur,

I found that if you call this right after your Visibility switch, it seems to work:
HiddenGroup.InvalidateVariants();


Actipro Software Support

Posted 8 years ago by Arthur Damen
Avatar
Thanks, this helps.

But could this be changed. Looks like a bug to me.
It is very annoying.
Couldn't be that hard to calculate the actualwidth internally.
The latest build of this product (v2019.1 build 0681) 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.