Hi,
I need to know the Cursor position of a XamTextEditor.
I can know only SelectionStart and SelectionLength.
Any suggests,
Thanks Andrea
Normal 0 false false false EN-US X-NONE X-NONE
Hello,
The XamTextEditor uses a TextBox (PART_FocusSite) when in edit mode and a TextBlock otherwise. With a normal textbox you can find the cursor position by using the SelectionStart property. When using the XamTextEditor this property can only be found from the underlying textbox when in edit mode, therefore the best option would be to capture this value when you are exiting edit mode. For example:
private void xamEditor_EditModeEnding(object sender, Infragistics.Windows.Editors.Events.EditModeEndingEventArgs e)
{
TextBox tb = (TextBox) GetChild(xamEditor, "PART_FocusSite");
startPos = tb.SelectionStart;
}
Valerie