TextEditingTool

StockSharp.Xaml.Diagram.GXDiagram.Tool

The TextEditingTool is used to let the user interactively edit text in place.

Inherits: DiagramTool

Properties

AdornedPart
protected Part AdornedPart { get; }
value = textEditingTool.AdornedPart

Gets the current Part that the TextBlock is in.

EditorAdornment
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.

Starting
public TextEditingStarting Starting { get; set; }
value = textEditingTool.Starting
textEditingTool.Starting = value

Gets or sets how user gestures can start in-place editing of text.

TextBlock
public TextBlock TextBlock { get; set; }
value = textEditingTool.TextBlock
textEditingTool.TextBlock = value

Gets or sets the TextBlock that is being edited.

TextEditor
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

AcceptText
public void AcceptText(TextEditingReason reason)
textEditingTool.AcceptText(reason)

Finish editing by trying to accept the new text.

CanStart
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.

DoAcceptText
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.

DoActivate
public override void DoActivate()
textEditingTool.DoActivate()

Start editing the text for a TextBlock.

DoDeactivate
public override void DoDeactivate()
textEditingTool.DoDeactivate()

This stops the current transaction and removes the editor adornment.

DoMouseDown
public override void DoMouseDown()
textEditingTool.DoMouseDown()

If the user clicks elsewhere in the diagram, call TextEditingReason).

DoMouseUp
public override void DoMouseUp()
textEditingTool.DoMouseUp()

A click (mouse up) calls DoActivate if this tool is not already active and if CanStart returns true.

DoStart
public override void DoStart()
textEditingTool.DoStart()

When starting this tool, call DoActivate if there is a TextBlock supplied.

IsValidText
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

StartingProperty
public static readonly DependencyProperty StartingProperty
value = TextEditingTool.StartingProperty

Identifies the Starting dependency property.