Example #1
0
        protected override void ClearItems()
        {
            var oldVal = this.Items.ToList();

            _undoManager.AddUndoAction(() =>
            {
                foreach (var it in oldVal)
                {
                    base.Add(it);
                }
            });
            base.ClearItems();
        }
Example #2
0
 /// <summary>
 /// Call PropertyChanged event if not null
 /// </summary>
 /// <param name="property">Property that has changed</param>
 protected void NotifyPropertyChanged(string property, Action undoAction)
 {
     _undoManager.AddUndoAction(undoAction);
     NotifyPropertyChanged(property);
 }