TextEditingTool
The TextEditingTool is used to let the user interactively edit text in place.
Inherits: DiagramTool
Properties
protected Part AdornedPart { get; }
value = textEditingTool.AdornedPart
Gets the current Part that the TextBlock is in.
public Adornment EditorAdornment { get; set; }
value = textEditingTool.EditorAdornment
textEditingTool.EditorAdornment = value
Gets or sets the "editor" Adornment that contains the control used to edit the text.
public TextEditingStarting Starting { get; set; }
value = textEditingTool.Starting
textEditingTool.Starting = value
Gets or sets how user gestures can start in-place editing of text.
public TextBlock TextBlock { get; set; }
value = textEditingTool.TextBlock
textEditingTool.TextBlock = value
Gets or sets the TextBlock that is being edited.
public ITextEditor TextEditor { get; set; }
value = textEditingTool.TextEditor
textEditingTool.TextEditor = value
Gets or sets the "editing" code that manages the interactions of the EditorAdornment.
Methods
public void AcceptText(TextEditingReason reason)
textEditingTool.AcceptText(reason)
Finish editing by trying to accept the new text.
public override bool CanStart()
result = textEditingTool.CanStart()
The TextEditingTool may run when there is a mouse-click on a TextBlock for which the go:Part.TextEditable attached property is true in a Part that IsSelected.
protected virtual bool DoAcceptText()
result = textEditingTool.DoAcceptText()
Modify the TextBlock's Text property to the new text string value if it String).
Returns: True if it succeeds, false if String) was false.
public override void DoActivate()
textEditingTool.DoActivate()
Start editing the text for a TextBlock.
public override void DoDeactivate()
textEditingTool.DoDeactivate()
This stops the current transaction and removes the editor adornment.
public override void DoMouseDown()
textEditingTool.DoMouseDown()
If the user clicks elsewhere in the diagram, call TextEditingReason).
public override void DoMouseUp()
textEditingTool.DoMouseUp()
A click (mouse up) calls DoActivate if this tool is not already active and if CanStart returns true.
public override void DoStart()
textEditingTool.DoStart()
When starting this tool, call DoActivate if there is a TextBlock supplied.
protected virtual bool IsValidText(string oldstring, string newstring)
result = textEditingTool.IsValidText(oldstring, newstring)
Decide whether the proposed new text string is valid.
- oldstring
- newstring
Returns: By default this returns true
Fields
public static readonly DependencyProperty StartingProperty
value = TextEditingTool.StartingProperty
Identifies the Starting dependency property.