Exemplo n.º 1
0
 public void MakeHistory(string id = "")
 {
     if (!TrackChanges)
     {
         return;
     }
     if (id == null)
     {
         id = "";
     }
     if (id == "" || id != lastid)
     {
         UndoBuffer.AddLast(Model.Clone());
         RedoBuffer.Clear();
         if (UndoBuffer.Count > 100)
         {
             UndoBuffer.RemoveFirst();
         }
         UnsavedChanges++;
         Device.BeginInvokeOnMainThread(() =>
         {
             Save.ChangeCanExecute();
             Undo.ChangeCanExecute();
             Redo.ChangeCanExecute();
         });
     }
     lastid = id;
 }