lundi 11 mars 2019

C# WPF built in ICommand Interface and the Command Design Patttern

I am new to WPF and c# in general. I was reading about the Command Design Pattern and was looking forward to implement it on my new application so that it could have do and undo functionality. Then i realized that WPF already comes with a ICommand Interface and that de xml buttons can implement it. Said interface have this methods:

public bool CanExecute(object parameter)
{
}

private void OnCanExecuteChanged()
{
}

public void Execute(object parameter)
{
}

So, should i add the undo funcionality to this already build in ICommand Interface by having some other interface inherit from it and add the undo method?

is this interface ment only for buttons? I mean, i would like to create many other commands that are not necesarilly connected to a xnml button

thanks in advance!

Aucun commentaire:

Enregistrer un commentaire