Problem with focus scope in WPF.(rredcat.blogspot.com)
submitted by
RredCat(299) 3 years, 9 months ago
WPF contains interesting static class FocusManager. This class (more precisely: its static method SetIsFocusScope) allows to set the specified DependencyObject as a focus scope (You can read more about it here).
But we have a limitation that didn't describe in MSDN (or more precisely, I not found). We can't use all controls that were inherited from ButtonBase in this focus scope, as these controls can't capture Keyboard.Focus in this focus scope. In OnLostMouseCapture method validates whether button is located in main window's focus scope. So if it isn't, control loses Keyboard.Focus (its be after Click event).
|category: Windows Presentation Foundation
|Views: 59
tags:
FocusManager Keyboard.Focus WPF FocusScope another
Everyones tags:
Your Tags: