Button.IsChecked Property (Binding)

Ribbon for WPF Forum

Posted 15 years ago by Daniel
Version: 9.2.0514
Avatar
Hello ActiPro

I want to simply bind to an Property in a Context. It will just runs great with a RibbonCheckBox or an ToggleButton (CustomControl). But it just happen nothing with a RibbonButton:

Neither of this worked:

<ribbon:Button ImageSourceLarge="{StaticResource ImageSpellCheck}" Label="SpellCheck" IsChecked="{Binding IsSpellcheckEnabledP.Value}"/>

<ribbon:RibbonButton ImageSourceLarge="{StaticResource ImageSpellCheck}" Label="SpellCheck">
                                <ribbon:Button.CommandParameter>
                                    <ribbon:CheckableCommandParameter IsChecked="{Binding IsSpellcheckEnabledP.Value}" />
                                </ribbon:Button.CommandParameter>
                            </ribbon:RibbonButton>
Thank you for your Support

Ynas

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Ynas,

Binding to the command parameter's IsChecked won't update anything until the command's CanExecute is run again. If you call CommandManager.InvalidateRequerySuggested() afterwards it may work.

However our ribbon button has an IsChecked property on it you can bind to as well. That will update the command parameter's IsChecked property if it is changed.


Actipro Software Support

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