private static void OnClosed(object?sender, EventArgs eventArgs) { if (sender is Window window) { window.Closed -= OnClosed; TouchKeyboard.Hide(); } }
private static void OnLostFocus(object sender, RoutedEventArgs e) { var textBox = Keyboard.FocusedElement as System.Windows.Controls.TextBox; if (textBox == null || !GetShowTouchKeyboardOnTouchEnter(textBox)) { TouchKeyboard.Hide(); } }
private static void OnLostFocus(object sender, RoutedEventArgs e) { if (!IsShowTouch(Keyboard.FocusedElement) && IsShowTouch(sender)) { TouchKeyboard.Hide(); } bool IsShowTouch(object?o) { return(o is System.Windows.Controls.TextBox focused && GetShowTouchKeyboardOnTouchEnter(focused)); } }
private static void OnClosed(object sender, EventArgs eventArgs) { ((Window)sender).Closed -= OnClosed; TouchKeyboard.Hide(); }