c# - Undo of a collection - Monitored Undo Framework -


i trying implement undo , redo application. realize stuff - i'm using monitored undo framework , mvvm light.

here code (without canexecute,..)

    public class viewmodel_main : viewmodelbase, isupportsundo         {             public viewmodel_main(iradataservice dataservice)             {                 networks = new observablecollection<viewmodel_network>();             }    private const string networkspropertyname = "networks";     private observablecollection<viewmodel_network> _networks;     public observablecollection<viewmodel_network> networks     {                 {             return _networks;         }         set         {             _networks = value;             raisepropertychanged(networkspropertyname);         }     }              private void addnetworkcommand_execute()             {                 viewmodel_network newnetwork = new viewmodel_network("undefinded.ranet", "x");                 defaultchangefactory.current.onchanging(this, networkspropertyname, networks, newnetwork);                 networks.add(newnetwork);             }              private void undocommand_execute()             {                 undoservice.current[this].undo();             }              public object getundoroot()             {                 return this;             }     } 

so let's problem: undo not work.. why?

thank you!


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -