StackPanel only shows 3 items

Ribbon for WPF Forum

Posted 4 years ago by Sebastian Starosielec - Class 5 Photonics GmbH
Version: 17.2.0661
Platform: .NET 4.5
Environment: Windows 10 (64-bit)
Avatar

I have a problem with the StackPanel.

In code like this:

<ribbon:StackPanel Name="NavigationPanel1" ItemVariantBehavior="LargeThenMediumWhenMedium" MinHeight="72" Margin="0,0,0,0">
<ribbon:Button Name="BtnPause" Command="app:ProjectCommands.Pause"/>
<ribbon:Button Name="BtnPlay" Command="app:ProjectCommands.Play"/>
<ribbon:Button Name="BtnPrevious" Command="app:ProjectCommands.Previous"/>
<ribbon:Button Name="BtnNext" Command="app:ProjectCommands.Next"/>
</ribbon:StackPanel>

only the first 3 Buttons are displayed - in the application as well as the Visual Studio XAML renderer.

It doesn't look like the BtNext itself is the problem, rearranging the order will still show only the first 3 buttons.

Given the version is somewhat "old", is this a common problem ?

Comments (1)

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

Hi Sebastian,

That is by design.  The ribbon:StackPanel is intended for use within a Ribbon group and is meant to only show 1-3 items, while giving you full control over the variant layouts of those items.  If you want to show four or more items, then you'd need to split your items into two or more StackPanels.  Such as putting the first two ribbon:Buttons in one StackPanel and the second two in another. 

Also, you don't want to ever set properties like MinHeight or Margin on StackPanel, as that will prevent variants from working properly.


Actipro Software Support

The latest build of this product (v24.1.1) 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.