/// <summary> /// Changes the paint style of the selected entities /// </summary> /// <param name="paintStyle"></param> public void ChangeStyle(IPaintStyle paintStyle) { //note that you need a copy of the selected item otherwise the undo/redo will fail once the selection has changed FillStyleCommand cmd = new FillStyleCommand(this, Selection.SelectedItems.Copy(), paintStyle); this.UndoManager.AddUndoCommand(cmd); cmd.Redo(); }