Separator casuses CanExecute bug

Ribbon for WPF Forum

Posted 16 years ago by Owen Christensen - Software Engineer, Minitab Inc.
Version: 4.5.0484
System: .NET 3.5, Windows Vista, 64-bit

<Window x:Class="WpfApplication3.Window1"
    Title="Window1" WindowState="Maximized">
        <ribbon:RibbonCommand x:Key="ChangeAlignmentCommand" Label="CommandLabel"/>
        <CommandBinding Command="{StaticResource ChangeAlignmentCommand}" CanExecute="CommandBinding_CanExecute"/>
                <ribbon:PopupButton Label="{Binding RelativeSource={RelativeSource Self}, Path=IsEnabled}">
                        <ribbon:Button Command="{StaticResource ChangeAlignmentCommand}" CommandParameter="Left" Label="Left"/>
                        <ribbon:Button Command="{StaticResource ChangeAlignmentCommand}" CommandParameter="Top" Label="Top"/>

  private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
    e.CanExecute = false;
If you run the above window as given the PopupButton is disabled as expected; all child buttons cannot execute so the parent should not be enabled.
However, uncomment the Separator and the PopupButton becomes enabled. This is _always_ true, regardless of the state of any children and incorrect.

Comments (1)

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

Good catch, we'll get this resolved for the next maintenance release.

Actipro Software Support

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.