this.timer.Tick += this.timer_Tick;
this.timer.Start();
+ this.GettingFocus += FooTextBox_GettingFocus;
+ this.LosingFocus += FooTextBox_LosingFocus;
+
this.SizeChanged += FooTextBox_SizeChanged;
this.Loaded += FooTextBox_Loaded;
}
}
- /// <inheritdoc/>
- protected override async void OnGotFocus(RoutedEventArgs e)
+ private void FooTextBox_LosingFocus(UIElement sender, LosingFocusEventArgs args)
{
- base.OnGotFocus(e);
+ this.RemoveTextContext();
- System.Diagnostics.Debug.WriteLine("got focus");
+ System.Diagnostics.Debug.WriteLine("losing focus");
+ }
+ private async void FooTextBox_GettingFocus(UIElement sender, GettingFocusEventArgs args)
+ {
+ System.Diagnostics.Debug.WriteLine("getting focus");
if (this.textServiceManager == null)
{
await Task.Delay(500);
}
this.CreateTextContext();
+ }
+
+ /// <inheritdoc/>
+ protected override void OnGotFocus(RoutedEventArgs e)
+ {
+ base.OnGotFocus(e);
+
+ System.Diagnostics.Debug.WriteLine("got focus");
this.View.IsFocused = true;
this.timer.Interval = new TimeSpan(0, 0, 0, 0, Interval);
this.CreateTextContext();
}
- /// <inheritdoc/>
+ /// <inheritdoc/>
protected override void OnLostFocus(RoutedEventArgs e)
{
base.OnLostFocus(e);
- this.RemoveTextContext();
-
System.Diagnostics.Debug.WriteLine("lost focus");
this.View.IsFocused = false;