I have a question, i watched a lot of tutorial about MVVM but i'm still confused. I have an interface with more than one button on it, i have to implement the ICommand interface for bind the command to the View.
I did it like this:
MainSolution
Main Solution
Model
SomeClass.cs
ViewModel
Commands
SomeCommands.cs
SomeViewModel.cs
Ok, now in the interface i have more than one button, each one do separate things, example, one is for start a thread the other one for cancel it and a third one for another thing. Should i create a separate class, that implement ICommand interface, for each button that i have on the View?
Main Solution
Model
SomeClass.cs
ViewModel
Commands
StartCommands.cs
CancelCommands.cs
OtherCommands.cs
SomeViewModel.cs
I'm asking this because when i implement the ICommand interface i have only one "Execute" method, and only one "CanExecute" method. What is the common way to implement multiple button on a View through binding?
I searched for example online without any luck... A lot of them are so confusing, and surely not for a newbie like me.
The other thing is when i have multiple View and Multiple ViewModel, should i create multiple Commands Folder for nesting it?
Main Solution
Model
SomeClass.cs
ViewModel
FirstCommands
StartCommands.cs
CancelCommands.cs
OtherCommands.cs
SecondCommands
StartCommands.cs
CancelCommands.cs
OtherCommands.cs
FirstViewModel.cs
SecondViewModel.cs