Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Well, in WPF, the use of the MVVM pattern is popular, so they often use Binding to data and commands (from the ViewModel) instead of code behind in the View itself (Window.xaml.cs).
And the command, for example, is convenient that there is CanExecute, where you can easily set the conditions for enabling the button.
Imagine that you have two buttons that should call the same function, and if one button is pressed, then both buttons should be blocked, and it becomes available again only when the action is completed.
1) If you do this using click, then you yourself need to prescribe the blocking of buttons after clicking on one of them, and at the end of the action, unblock them yourself.
2) If this is done using command, then the buttons will be automatically blocked and unblocked depending on whether this command is currently being executed (using the CanExecute command event)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question