Node Text in edit mode when dropped

Hello,

is it possible to set the text of a node in editing mode when it is dropped into a diagram?

Thank you

Sure. Assuming you have set go:Part.TextEditable=“True” on a TextBlock in your Node’s DataTemplate, you just need to start editing upon a drop:

myDiagram.ExternalObjectsDropped += (s, e) => { myDiagram.CommandHandler.Edit(); };

Thank you very much,
I have another issue.
When I edit a node’s text using the editing tool the old value remains under the editing toolbox and it’s annoying. Is there a way to fix this?

thank you again

I’ll post a picture of the issue:

Thank you for your time.

Andrew

I suppose you could customize the TextEditingTool.
I haven’t tried this, but you could override DoActivate to call the base method and then either change the appearance of the TextBlock being edited or insert an opaque object in front of the edited TextBlock or Node.
An override of DoDeactivate would call the base method and then undo what DoActivate did.

Thank you Walter,
I resolved the issue setting the textblock.text = “” after the base.DoActivate() call.