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
Post a Comment