private void RemoveTextContext()
{
- this.textEditContext.NotifyFocusLeave();
this.textEditContext.CompositionStarted -= TextEditContext_CompositionStarted;
this.textEditContext.CompositionCompleted -= TextEditContext_CompositionCompleted;
this.textEditContext.LayoutRequested -= TextEditContext_LayoutRequested;
this.textEditContext.FormatUpdating -= TextEditContext_FormatUpdating;
this.textEditContext.FocusRemoved -= TextEditContext_FocusRemoved;
this.textEditContext.NotifyFocusLeaveCompleted -= TextEditContext_NotifyFocusLeaveCompleted;
+ this.textEditContext.NotifyFocusLeave();
}
/// <inheritdoc/>
int start = req.Range.StartCaretPosition;
int length = req.Range.EndCaretPosition - req.Range.StartCaretPosition;
+ if (length > this.Document.Length)
+ length = this.Document.Length;
System.Diagnostics.Debug.WriteLine("req text start:{0} length:{1}", start, length);
void FooTextBox_Loaded(object sender, RoutedEventArgs e)
{
- //this.Focus(FocusState.Programmatic);
+ this.Focus(FocusState.Programmatic);
}
void timer_Tick(object sender, object e)