xceedsoftware / wpftoolkit

All the controls missing in WPF. Over 1 million downloads.
Other
3.86k stars 868 forks source link

SplitButton: IsEnabled property is ignored when Command is used #1466

Open bad-samaritan opened 5 years ago

bad-samaritan commented 5 years ago

Hello, In my WPF app I recently changed System.Windows.Controls.Button to Xceed.Wpf.Toolkit.SplitButton and noticed that IsEnabled property stopped working. I turned out that in SplitButton Property IsEnabled is ignored when Command Property is used. After some investigation I discovered that SplitButton is expecting that when someone is using Command Property they will also use CanExecute to establish whether given button should be enabled, so IsEnabled is not needed anymore.

I'm not sure if this is a bug or expected behavior however, even if this is works-as-expected case I think that it should be at least mentioned in summary of SplitButton. Especially that for System.Windows.Controls.Button this behavior is different => IsEnabled works when using RelayCommand without CanExecute.

Details:

XceedBoucherS commented 5 years ago

Hi, Can you submit a sample so you could test the same scenario as you ? Thank you.

bad-samaritan commented 5 years ago

I was afraid you would ask about this. Unfortunately I can't share the code of mentioned app but I will try to write a simple PoC app to present the issue when I have some time. Thanks for picking it up.