In my configuration I have a "Load Map" function that loads all of the Feature Services on the Map and Renders them for the user. With the new Undo/Redo functionality for the Feature Service I am working on getting my users used to it. However, when i load a map, add the Layers, and Render the Layers, the undo button becomes available to the user, even if I save edits and save project in the code. I don't want the user to be able to undo my rendering and layer loading? I want them to start off with no Redo or Undo available. The OperationManager doesn'ts seem to have any entries in it?
//I don't know how to even find the categories available, but I want to remove all of them anyways and start with blank undo/redo stack
//Here is my initial attempt (Category??)
OperationManager _operationManager = new OperationManager();
List<Operation> ops = _operationManager.FindUndoOperations(o => o.Category == "Update Map Properties");
//Nother with != either
//So it must be empty?
ops = _operationManager.FindUndoOperations(o => o.Category != "Update Map Properties");
//This will fail/error as ops is empty
Maybe using await Project.Current.SaveAsync(); to force save the project once everything is loaded and rendered the way you want would disable the Undo button so users can't backout the changes your code did.