Menu Items with Command; Label not disabling

Ribbon for WPF Forum

Posted 16 years ago by Tim Mawson
Version: 4.0.0456
Platform: .NET 3.5
Environment: Windows XP (32-bit)
Avatar
I've noticed that when a button that has a command attached is placed within a ribbon:ApplicationMenu or ribbon:Menu, and the command is disabled (CanExecute returns false) the label of the button remains in an "enabled" state, while the image is disabled and the button cannot be pressed, as expected. I would have expected all elements of the button to be rendered using disabled styles.

Is this a bug?

Comments (3)

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

When I'm doing some testing on this I'm seeing it work correctly. In our main demo, if I modify the menu off the Paste split button in the Home tab to have this item, I see text disabled:
<ribbon:Button Command="sample:ApplicationCommands.Disabled" ImageSourceSmall="/Resources/Images/PasteSpecial16.png" Label="Paste Special" KeyTipAccessText="S" Id="Paste" />
Can you provide a simple repro example (either similar code we can try or a simple sample project) that shows it happening?


Actipro Software Support

Posted 16 years ago by Krijn Michiels
Avatar
I have the same problem.

You can follow following steps to reproduce the bug :

Add lines to SampleApplication\ProductSamples\RibbonSamples\Demo\DocumentEditor\MainControl.xaml.cs :

private void fileNewCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = false;
}


Change CommandBinding for command ApplicationCommands.New :

this.CommandBindings.Add(new CommandBinding(System.Windows.Input.ApplicationCommands.New, fileNewCommand_Execute, fileNewCommand_CanExecute));

Launch samplebrowser and open ribbon sample


Swith theme to blue (mine defaults black)

Ribbon button foreground for command New stays blue ..



Greetings
Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi, I believe we fixed this in the latest maintenance release from last week. Can you try build 457 to see if it is still happening for you?


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.