My project has a viewmodel class in which I have inherited RelayCommand and ICommand.
A Command called ExecuteCommand is created in this view model as shown below and is working fine.
public class LoginWindowViewModel:WorkSpaceViewModel
{
RelayCommand _executecommand;
public ICommand ExecuteCommand
{
get
{
if (_executecommand == null)
{
_executecommand = new RelayCommand(param => Execute(),param => CanExecute());
}
return _executecommand;
}
}
public virtual void Execute()
{
MainWindow window = new MainWindow();
window.Show();
}
public virtual bool CanExecute()
{
return true;
}
}My question is, how can I create another command in the same view model and how to use it.