StackPanel only shows 3 items

Ribbon for WPF Forum

Posted 5 months ago by Sebastian Starosielec
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 5 months 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 (v2020.1.0) was released 17 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.