using System.Windows; using System.Windows.Input; namespace HKW.WPF.Extensions; public static partial class WPFExtensions { /// /// 清除元素焦点 /// /// 元素 public static void ClearFocus(this DependencyObject obj) { FocusManager.SetFocusedElement(FocusManager.GetFocusScope(obj), null); } }