X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=UWP%2FFooEditEngine.UWP%2FFooTextBox.cs;fp=UWP%2FFooEditEngine.UWP%2FFooTextBox.cs;h=90f9659bab7d57657c4b9f5c0a26bf822bbc49f5;hb=0fc57c3fbeec049669b8e5c6d8e451207ca72e3a;hp=26ebcef41d0f00ef57a5fb2f8dd372f9a23d34cb;hpb=bc3b0bb6e5a63b9377dc081778c7306a6d7c91c6;p=fooeditengine%2FFooEditEngine.git diff --git a/UWP/FooEditEngine.UWP/FooTextBox.cs b/UWP/FooEditEngine.UWP/FooTextBox.cs index 26ebcef..90f9659 100644 --- a/UWP/FooEditEngine.UWP/FooTextBox.cs +++ b/UWP/FooEditEngine.UWP/FooTextBox.cs @@ -468,7 +468,6 @@ namespace FooEditEngine.UWP private void RemoveTextContext() { - this.textEditContext.NotifyFocusLeave(); this.textEditContext.CompositionStarted -= TextEditContext_CompositionStarted; this.textEditContext.CompositionCompleted -= TextEditContext_CompositionCompleted; this.textEditContext.LayoutRequested -= TextEditContext_LayoutRequested; @@ -479,6 +478,7 @@ namespace FooEditEngine.UWP this.textEditContext.FormatUpdating -= TextEditContext_FormatUpdating; this.textEditContext.FocusRemoved -= TextEditContext_FocusRemoved; this.textEditContext.NotifyFocusLeaveCompleted -= TextEditContext_NotifyFocusLeaveCompleted; + this.textEditContext.NotifyFocusLeave(); } /// @@ -723,6 +723,8 @@ namespace FooEditEngine.UWP 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); @@ -1165,7 +1167,7 @@ namespace FooEditEngine.UWP void FooTextBox_Loaded(object sender, RoutedEventArgs e) { - //this.Focus(FocusState.Programmatic); + this.Focus(FocusState.Programmatic); } void timer_Tick(object sender, object e)