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

Hi,
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"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
Title="Window1" Height="400" Width="600">
<DockPanel>
<Ribbon:Ribbon DockPanel.Dock="Top" >
<Ribbon:Tab Label="test">
<Ribbon:Group>
<Ribbon:PopupButton Label="Try to copy" AutoDisableWhenPopupContentIsDisabled="True" Command="ApplicationCommands.NotACommand" >
<Ribbon:Menu>
<Ribbon:Button Label="Copy does not get enabled anymore" Command="Copy"/>
</Ribbon:Menu>
</Ribbon:PopupButton>
<Ribbon:Button Label="Copy enabled when selection not empty = ok" Command="Copy"/>
</Ribbon:Group>
</Ribbon:Tab>
</Ribbon:Ribbon>
<TextBox />
</DockPanel>
</Ribbon:RibbonWindow>
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"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
Title="Window1" Height="400" Width="600">
<DockPanel>
<Ribbon:Ribbon DockPanel.Dock="Top" >
<Ribbon:Tab Label="test">
<Ribbon:Group>
<Ribbon:PopupButton Label="Try to copy" AutoDisableWhenPopupContentIsDisabled="True" Command="ApplicationCommands.NotACommand" >
<Ribbon:Menu>
<Ribbon:Button Label="Copy does not get enabled anymore" Command="Copy"/>
</Ribbon:Menu>
</Ribbon:PopupButton>
<Ribbon:Button Label="Copy enabled when selection not empty = ok" Command="Copy"/>
</Ribbon:Group>
</Ribbon:Tab>
</Ribbon:Ribbon>
<TextBox />
</DockPanel>
</Ribbon:RibbonWindow>