6 Answers, 1 is accepted
I tested the IsEnabled button and its seem to work properly on my side. I created a new WPF application and used the following XAML to test this.
<
telerik:RadRibbonView
>
<
telerik:RadRibbonView.Backstage
>
<
telerik:RadRibbonBackstage
>
<
telerik:RadRibbonBackstageItem
Header
=
"Save"
IsSelectable
=
"False"
IsEnabled
=
"False"
/>
</
telerik:RadRibbonBackstage
>
</
telerik:RadRibbonView.Backstage
>
</
telerik:RadRibbonView
>
Regards,
Martin Ivanov
Progress Telerik
Martin,
Thanks for the speedy response. If I stripped the item down to just Header, IsSelectable and IsEnabled everything worked as expected, including binding it to a Boolean on the view model. So we've got something else in our solution that's causing the trouble. The only remaining difference seems to be the command, so I'll start by digging in there. Appreciate the help in ruling out one part of the puzzle.
Martin,
Can you test the IsEnabled button and see if it works properly on your side?
Thank you,
<telerik:RadRibbonView>
<telerik:RadRibbonView.Backstage>
<telerik:RadRibbonBackstage>
<telerik:RadRibbonBackstageItem Header="Save" IsSelectable="False" IsEnabled="False" Command="{Binding SaveCommand}"/>
</telerik:RadRibbonBackstage>
</telerik:RadRibbonView.Backstage>
</telerik:RadRibbonView>
Now I see what could be the original issue. The Command property usually interferes with the IsEnabled of the corresponding element. If the command's CanExecute handler returns False (the command is not allowed) the IsEnabled is automatically set to False. If CanExecute returns True, IsEnabled is also True.
To resolve this, use the CanExecute command handler instead of IsEnabled.
Regards,
Martin Ivanov
Progress Telerik
Thanks for the speedy response. It works. Thanks