<Button Content="Hello" Command="{Binding HelloCommand}"/> <!-- Works OK -->
<Button Content="Hello" Command="{Binding HelloCompositeCommand}"/> <!-- Nope :( -->
public class MainWindowViewModel : BindableBase
{
public DelegateCommand HelloCommand { get; set; }
public CompositeCommand HelloCompositeCommand { get; set; }
public MainWindowViewModel()
{
HelloCommand = new DelegateCommand(SayHello, CanSayHello) {IsActive = true};
HelloCompositeCommand = new CompositeCommand(true);
HelloCompositeCommand.RegisteredCommands.Add(HelloCommand);
}
private bool CanSayHello()
{
return true;
}
private void SayHello()
{
Debug.WriteLine("Hi!");
}
}