Here's some sample code to reproduce the problem :
<StackPanel Width="100">
<ToggleButton Content="Test 1"/>
<ToggleButton Content="Test 2"/>
<ToggleButton Content="Test 3"/>
<StackPanel FocusManager.IsFocusScope="True">
<ToggleButton Content="Test 4"/>
<ToggleButton Content="Test 5"/>
<ToggleButton Content="Test 6"/>
</StackPanel>
</StackPanel>
If you tab through the ToggleButtons, the first 3 you can check/uncheck with the space bar without an issue because the keyboard focus remains on the item you change. But if you click/tab through boxes 4-6 that are in the focus scope and try to change them via the spacebar, the focus is reset outside of that focus scope, and subsequent spacebar presses get executed outside the focus scope.
How do I prevent the keyboard focus from leaving when changing data in a section where IsFocusScope=True
?