Closed Revsol closed 8 years ago
Yes and No, the CanAddTab function should not allow that the Button can be clicked. Try to Bind the Command to a normal Button and you can see what i mean, the Button will be grayed and can't be clicked. You use the MVVM Light Toolkit in your Demo, when you take a look at the Source of the Toolkit, you will see that the RelayCommand don't check if he can Execute, he just executes the Action.
public void Execute(object parameter)
{
_execute();
}
I'm afraid i don't fully understand what isn't working for you.
Is the problem that the button visually appears to be able to click, or that the button actually spawns new tabs when you click it.
Sorry, my english is not the best ;) The standard behavior should be that the Button is not clickable when CanExecute is false. Because this is how all Buttons work in WPF. But the AddTabButton ignores the CanExecute. Its not good for User experience if he see a clickable Button that does nothing.
I know, i annoy you with all this issues^^, but i really like the Tabcontrol and i want it to work with it. But unfortunately it has currently to many flaws to work with. I hope you understand that i just try to improve this already great control.
It's no bother, i just misunderstood. i'll try add it for next update.
And remember, If you want to contribute, feel free to fork it and make a pull request :)
This issue is fixed in version 1.2
Great, thx
It's the responsibility of the Command you register to implement CanExecute, i.e the one in your ViewModel. So using the demo project as an example: