Triggers on Ribbon Buttons

Ribbon for WPF Forum

Posted 15 years ago by Martin - Blaise - Statistics Netherlands
Version: 9.1.0507

In a contextmenu i want to hide the Buttons instead of make them disabled. All buttons are connected to a (Ribbon)command.
        <Style x:Key="ContextButton" TargetType="ribbon:Button">
                <Trigger Property="IsEnabled" Value="True" >
                    <Setter Property="Visibility" Value="Visible" />
                <Trigger Property="IsEnabled" Value="False" >
                    <Setter Property="Visibility" Value="Collapsed" />
   <ribbon:Button Command="ide:ApplicationCommands.CloseSolution" 
           Style="{StaticResource ContextButton}" />

Somehow the buttons disappear... i guess the " collapsing" works but never re-appear.

What to do:)


Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Martin,

We have an optimization in there to keep performance of the application high so that invisible controls don't update their can execute state. Try this, inherit a ribbon:Button and override its CanUpdateCanExecuteWhenHidden property to return true. Use an instance of that inherited class and see if it works for you.

Actipro Software Support

The latest build of this product (v24.1.2) 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.