PopupButton Enabling

Ribbon for WPF Forum

Posted 16 years ago by Bryan Livingston
Version: 3.0.0410
Environment: Windows XP (32-bit)
Avatar
There seems to be a problem with the PopupButton. I've got some buttons on the menu that are sometimes disabled (when there is no drawing loaded). The buttons get enabled correctly, but the PopupButton does not, so you can't get to the buttons. When the user switches away to another tab and then back again, the PopupButton is correctly enabled.

You can see this at the latest build at http://vectorstudio.com/Run The Orientation PopupButton is disabled by default, when the buttons it contains are enabled.

Here is the xaml for the button. You can see that the Portrait button is enabled as I've copied it out of the PopupButton.

                    <ribbon:Group Label="Page Setup" Command="{x:Static v:ShowPagePropertiesCommand.Command}" >
                        <ribbon:Button Label="Portrait" Command="{x:Static v:SetPageOrientationCommand.Command}" />
                        
                        <ribbon:PopupButton Label="Orientation">
                            <ribbon:Menu ItemVariantSize="Large" >
                                <ribbon:Button Label="Portrait" Command="{x:Static v:SetPageOrientationCommand.Command}" />
                                <ribbon:Button Label="Landscape" Command="{x:Static v:SetPageOrientationCommand.Command}" CommandParameter="{x:Static v:PageOrientation.Landscape}" />
                            </ribbon:Menu>
                        </ribbon:PopupButton>
...

Comments (2)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Bryan,

What happens if you call CommandManager.InvalidateRequerySuggested?

What is happening here is that there is built-in functionality to disable a popup button or split button if it thinks all the child items are disabled. This is a Microsoft requirement. But if one of them re-enables, it should be enabling itself again so it sounds like there is a bug here. Can you throw together a tiny sample project that shows it happening and email that over?

But as a workaround, we have a AutoDisableWhenPopupContentIsDisabled on PopupButtonBase that you can set to false. That will disable this functionality.


Actipro Software Support

Posted 16 years ago by Bryan Livingston
Avatar
I had tried playing with InvalidateRequerySuggested and it didn't have any effect.

The AutoDisableWhenPopupContentIsDisabled workaround works great.

If I can find some time I'll build a repro and send it over.

Thanks.

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

Add Comment

Please log in to a validated account to post comments.