My XAML:
<Grid Background="White">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<ScrollViewer Grid.Column="0">
<StackPanel>
<Grid Margin="5" Background="LightGray">
<TextBlock>Grid1</TextBlock>
</Grid>
<TextBlock Margin="5">TextBlock1</TextBlock>
<CheckBox Margin="5">CheckBox1</CheckBox>
<Button Margin="5">Button1</Button>
</StackPanel>
</ScrollViewer>
<StackPanel Grid.Column="1">
<Grid Margin="5" Background="LightGray">
<TextBlock>Grid2</TextBlock>
</Grid>
<TextBlock Margin="5">TextBlock2</TextBlock>
<CheckBox Margin="5">CheckBox2</CheckBox>
<Button Margin="5">Button2</Button>
</StackPanel>
</Grid>
That gives this output:
Here's my problem. If Button2 has focus clicking on Grid2 or TextBlock2 will not change focus. However if Button1 has focus and clicking on Grid1 or TextBlock1, then focus will be removed from Button1. Why? For me it looks like when you surround a panel with a ScrollViewer the focus logic is broken.
Thanks in advance.