Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
PreviewKeyDown/KeyUp not tunnelling
Message
De
06/03/2010 14:48:47
 
 
À
06/03/2010 14:48:11
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01452829
Message ID:
01452939
Vues:
24
>>>Hi,
>>>Thanks. That explains the behaviour. I'd tried setting Focusable=true but, alone, that didn't help....
>>>
>>>But the problem I have with the solution is that the KeyDown on the ScrollViewer doesn't now get handled. Well, I'll re-phrase that - the event does fire and gets marked as handled by the ScrollViewer but it doesn't perform any action (e.g. downarrow doesn't actually scroll down).....
>>>
>>>Maybe I need to rethink the approach. All I really need is for the ScrollViewer to handle it's navigation keys normally but for the 'inner' Canvas to handle (a limited number) of other keys.
>>>
>>>Any ideas?
>>
>>I would just handle the key events on the ScrollViewer instead of the canvas. It's a lot simpler that way.
>
>As is usually the case I'm afraid my example was an over-simplification. In reality elements of different types will be added to the 'inner' Canvas at runtime. The ScrollViewer itself will have no understanding of these objects or how they are supposed to behave in response to specific key presses.
>
>And, to complicate the explanation further, the 'outer' Canvas in my test is not, in reality, a Canvas at all but a UserControl and the 'inner' Canvas is actually sub-classed with a lot of app specific logic. The XAML guys who are doing the front end may or may not, depending on the circumstances, choose to stick a ScrollViewer between these two elements. But the 'outer' and 'inner' bits do communicate regardless of whether there's an intervening ScrollViewer so I may be able to catch the events in the 'outer' and pass them directly to the 'inner' - in effect leap-frogging the ScrollViewer if it's present......
Hope that made sense..
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform