From e989cbd881483d9dcb74cf9895142c6ea4aab594 Mon Sep 17 00:00:00 2001 From: Michael Becker Date: Tue, 24 Dec 2019 01:21:53 -0500 Subject: [PATCH] notify we have edited the text, but only if the editor control has been created --- .../Editors/Text/Plain/PlainTextEditor.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CSharp/Libraries/UniversalEditor.UserInterface/Editors/Text/Plain/PlainTextEditor.cs b/CSharp/Libraries/UniversalEditor.UserInterface/Editors/Text/Plain/PlainTextEditor.cs index 79d06d60..d86ea8dd 100644 --- a/CSharp/Libraries/UniversalEditor.UserInterface/Editors/Text/Plain/PlainTextEditor.cs +++ b/CSharp/Libraries/UniversalEditor.UserInterface/Editors/Text/Plain/PlainTextEditor.cs @@ -68,6 +68,11 @@ namespace UniversalEditor.Editors.Text.Plain private void txt_Changed(object sender, EventArgs e) { PlainTextObjectModel om = (this.ObjectModel as PlainTextObjectModel); + if (om == null) + return; + + if (!IsCreated) + return; if (!working) { @@ -75,9 +80,11 @@ namespace UniversalEditor.Editors.Text.Plain { BeginEdit(); } + om.Text = txt.Text; - txt.ResetChangedByUser(); + + OnDocumentEdited(EventArgs.Empty); } }