UIElement.OnIsKeyboardFocusWithinChanged(DependencyPropertyChangedEventArgs) Method


在此元素即将引发 IsKeyboardFocusWithinChanged 事件前调用。Invoked just before the IsKeyboardFocusWithinChanged event is raised by this element. 实现此方法可为此事件添加类处理。Implement this method to add class handling for this event.

 virtual void OnIsKeyboardFocusWithinChanged(System::Windows::DependencyPropertyChangedEventArgs e);
protected virtual void OnIsKeyboardFocusWithinChanged (System.Windows.DependencyPropertyChangedEventArgs e);
abstract member OnIsKeyboardFocusWithinChanged : System.Windows.DependencyPropertyChangedEventArgs -> unit
override this.OnIsKeyboardFocusWithinChanged : System.Windows.DependencyPropertyChangedEventArgs -> unit
Protected Overridable Sub OnIsKeyboardFocusWithinChanged (e As DependencyPropertyChangedEventArgs)



IsKeyboardFocusWithin 依赖属性的值发生更改时,将引发此虚方法。This virtual method is raised when the value of the IsKeyboardFocusWithin dependency property changes. 首先引发虚方法,并在必要时对事件数据进行操作。The virtual method is raised first and can manipulate the event data as necessary. 然后,将用相同的事件数据实例引发 IsKeyboardFocusWithinChanged 事件。Then the IsKeyboardFocusWithinChanged event is raised with that same event data instance. 请注意,IsKeyboardFocusWithinChanged 事件不是路由事件。Notice that the IsKeyboardFocusWithinChanged event is not a routed event. 因此,不能在类处理程序中将其标记为已处理。Therefore, you cannot mark it as handled in the class handler.

此方法没有默认实现。This method has no default implementation. 因为继承中的中间类可能实现此方法,所以建议您在实现中调用基实现。Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation. 您可以根据自己的要求,在特殊处理之前或之后调用 base。You may call base either before or after your special handling, depending on your requirements.

Applies to