diff --git a/FlowSharpLib/ExtensionMethods.cs b/FlowSharpLib/ExtensionMethods.cs index a44a9fa..b282ecf 100644 --- a/FlowSharpLib/ExtensionMethods.cs +++ b/FlowSharpLib/ExtensionMethods.cs @@ -340,6 +340,8 @@ public static void ChangePropertyWithUndoRedo(this GraphicElement el, string { if (redo) { + // TODO: If element is selected element (and only 1 selected element?) update property grid as well. + // Or simply select element undergoing undo/redo? el.Canvas.Controller.Redraw(el, _ => piElement.SetValue(el, redosave)); } else if (@do) @@ -349,6 +351,8 @@ public static void ChangePropertyWithUndoRedo(this GraphicElement el, string } else { + // TODO: If element is selected element (and only 1 selected element?) update property grid as well. + // Or simply select element undergoing undo/redo? el.Canvas.Controller.Redraw(el, _ => piElement.SetValue(el, save)); } }, finishGroup); diff --git a/FlowSharpUI.cs b/FlowSharpUI.cs index e548a89..6a3343f 100644 --- a/FlowSharpUI.cs +++ b/FlowSharpUI.cs @@ -332,9 +332,9 @@ protected void TerminateEditing() shapeBeingEdited.ChangePropertyWithUndoRedo("Text", editBox.Text); shapeBeingEdited.Text = editBox.Text; canvasController.Redraw(shapeBeingEdited); - - canvas.Controls.Remove(editBox); - editBox = null; + TextBox tb = editBox; + editBox = null; // set editBox to null so the remove, which fires a LoseFocus event, doesn't call into TerminateEditing again! + canvas.Controls.Remove(tb); // Updates PropertyGrid: canvasController.ElementSelected.Fire(this, new ElementEventArgs() { Element = shapeBeingEdited });