Posted 14 years ago
by BODY
Hi All,
We have some problems with a command binding.
We created a Ribbon with few button like that:When the tab containing these buttons is hidden, the CanExecute is evaluated.
Otherwise, is not. Do you have some ideas about this ??
We have some problems with a command binding.
We created a Ribbon with few button like that:
<ribbon:Group Label="Gestion des fichiers" Width="120">
<StackPanel>
<ribbon:PopupButton Label="Nouveau" ImageSourceLarge="../../Img/new-file.png" >
<ribbon:Menu x:Name="NewFileMenu"/>
</ribbon:PopupButton>
<ribbon:PopupButton Label="Ajouter" ImageSourceLarge="../../Img/add-file.png" >
<ribbon:Menu x:Name="AddFileMenu"/>
</ribbon:PopupButton>
</StackPanel>
</ribbon:Group>
Otherwise, is not. Do you have some ideas about this ??
private void FileAddCommand_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
e.CanExecute = MainController.Project != null;
}
<CommandBinding Command="{x:Static Local:CustomCommands.FileAdd}"
CanExecute="FileAddCommand_CanExecute"
Executed="FileAddCommand_Executed"/>