0

I'm using MVVM and WPF 4.5 Ribbon to activate views. Each activate command looks like this:

public void ActivateSearchDocuments()
{
    DisplayName = "Seach Documents - App";
    ActivateItem(IoC.Get<SearchViewModel>());
}

I know I can implement an Undo/Redo pattern using a circular queue. My doubt is: is it possible to store lazy references on that queue. I mean, how can I store that command on the queue in order to call it later.

I don't think delegates is the appropiate way. Is there something cleaner?

Erre Efe
  • 15,387
  • 10
  • 45
  • 77

1 Answers1

0

Command design pattern can give you ability to Undo/Redo http://www.dofactory.com/Patterns/PatternCommand.aspx#_self2

zzfima
  • 1,528
  • 1
  • 14
  • 21
  • +1 However, the Command pattern cannot be used to create a complete undo facility on its own (althoug it is the answer in this case). You would need the Memento Pattern for a complete implementation... – MoonKnight Dec 04 '12 at 13:31
  • @zzfima Problem isn't the pattern. I alreay let clear that. Problem is the implementation without delegates. Thanks but I don't see how this solves the question. – Erre Efe Dec 04 '12 at 14:06
  • This is not clear how Command pattern can be leveraged for Undo/Redo implementation, too broad I would say – sll Sep 12 '13 at 10:57