I am working ona WPF application that has a toolbar/menu that will have the use for several custom commands. Probably around 15-20. I have seen documentation on how to create custom commands, but none of them necessarily apply to what I am trying to do.
I am using a controller to handle the business logic in my application, and I am trying to keep my view from doing any logic at all.
What I would like to do is create a directory in my project that holds the custom command classes so that I can decouple them from the controller and the view, but I would still like them to be called from the view such as a normal commmand is.
I have also seen the use of a DelegateCommand class, but am not quite sure if that is the direction I want to head in.
I would like to be able to have an arbitrary custom command class such as the following
public CustomCommand: ICommandd
{
public bool CanExecute(object parameter)
{
//arbitrary logic
}
public void Execute(object parameter)
{
}
}
The idea is that I would have 10-20 of these, and I want to keep them separate from everything else, and have them be called when needed.
I know that there is a way I can separate my custom commands, but am not quite sure.
I am new to using commands, so I still am trying to get a hold of the concept.
thanks,