>>Hi,
>>Very simple WPF window:
<Window x:Class="TabTest.Window3"
>> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
>> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
>> <Canvas x:Name="Outer" Width="500" Height="500" Background="Beige">
>> <ScrollViewer x:Name="SV" Width="500" Height="500" >
>> <Canvas x:Name="Inner" Width="1000" Height="1000" Background="Red" ></Canvas>
>> </ScrollViewer>
>> </Canvas>
>></Window>
No Key events (i.e. PreviewKeyDown,KeyDown,PreviewKeyUp,KeyUp) fire on the 'Inner' Canvas.
>>The ScrollViewer behaves as I would expect by eating the KeyDown for 'action' keys such as the arrow keys - but I thought the other events would drill down to the inner canvas.
>>
>>What am I missing .......
>stupid question, but I think it bubbles by default. Have you set it to tunnel?
It should tunnel then bubble automatically. If I handle *all* the events in the example I see:
Outer PreviewKeyDown
SV PreviewKeyDown
SV KeyDown
Outer KeyDown
Outer PreviewKeyUp
SV PreviewKeyUp
SV KeyUp
Outer KeyUp
If I press, say, the downarrow this changes to :
Outer PreviewKeyDown
SV PreviewKeyDown
Outer PreviewKeyUp
SV PreviewKeyUp
SV KeyUp
Outer KeyUp
i.e the ScrollViewer eats the ScrollViewer.KeyDown so I lose that plus the Outer.KeyDown since it's marked as handled But that's OK - I was expecting it. But *no* events penetrate down to the 'inner' canvas. :-{