PopupButton enabled by child items

Ribbon for WPF Forum

Posted 15 years ago by Kris Goossens - Remmicom
Version: 9.1.0505
Platform: .NET 3.5
Environment: Windows 7 (32-bit)

Documentation says :
Disabling When Child Items Are All Disabled
One of the ribbon UI design requirements is that when a popup button's child items are all disabled, the popup button must also be disabled. Because of the way WPF commands work, the PopupButton control only examines child items if a command is assigned to its Command property. So as long as you have a command set to the PopupButton, this functionality will work. If you need to use a temporary command while prototyping, use ApplicationCommands.NotACommand.

If you would like to prevent this automated functionality from occurring, you can set the AutoDisableWhenPopupContentIsDisabled to false.

So we used Command="ApplicationCommands.NotACommand", but the popup button does not get enabled anymore.
(Worked fine in version 4.5.0483)

This is all you need to reproduce the problem :

<Ribbon:RibbonWindow x:Class="Window1"
Title="Window1" Height="400" Width="600">
<Ribbon:Ribbon DockPanel.Dock="Top" >
<Ribbon:Tab Label="test">
<Ribbon:PopupButton Label="Try to copy" AutoDisableWhenPopupContentIsDisabled="True" Command="ApplicationCommands.NotACommand" >
<Ribbon:Button Label="Copy does not get enabled anymore" Command="Copy"/>
<Ribbon:Button Label="Copy enabled when selection not empty = ok" Command="Copy"/>

<TextBox />

Comments (3)

Posted 15 years ago by Kris Goossens - Remmicom
In addition (but we don't need this one),

setting AutoDisableWhenPopupContentIsDisabled="False"

doesn't help either.
PopupButton stays disabled.

Kris G
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA

Thanks for the post, it looks like a change we made since then to allow the Command property to control the enabled state of the button if set broke this. We've updated our code for the upcoming maintenance release to not kick in our new code if the command is set to ApplicationCommands.NotACommand.

Thus in the next build, if the PopupButton.Command is set to ApplicationCommands.NotACommand, it will behave like it did in 4.5. If you set another command, that command will directly control the enabled state of the button. If no command is set and AutoDisableWhenPopupContentIsDisabled is false, it will remain enabled.

Actipro Software Support

Posted 15 years ago by Kris Goossens - Remmicom

I just used release 9.1.0506 and the PopupButton gets enabled again.

Thanks for the quick fix !

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

Add Comment

Please log in to a validated account to post comments.