Avalonia
Home
Support
GitHub Repository
Searchβ¦
π
Welcome
Documentation
β‘
Getting Started
π
Data Binding
π¨
Styling
π§°
Controls
π
Templates
β
Authoring Controls
π±
Input
π
Animations
π
Layout
π¦
Distribution / Publishing
API Reference
π§Ύ
Namespaces
Guides
π£
Basics
π€Ώ
Deep dives
π©π»
π©π» Developer Guides
Tutorials
π
ToDo List App
π»
Music Store App
Running in the Browser
π±
Developing for Mobile
Misc
πͺ
Community
π₯
WPF Developers Tips
Styling
DataTemplates
HierachicalDataTemplate
UIElement, FrameworkElement and Control
DependencyProperty
Grid
ItemsControl
Tunnelling Events
Class Handlers
PropertyChangedCallback
RenderTransforms and RenderTransformOrigin
π
Projects that are using Avalonia
β
FAQ
Powered By
GitBook
Tunnelling Events
Avalonia has tunnelling events but they're not exposed via separate
Preview
CLR event handlers. To subscribe to a tunnelling event you must call
AddHandler
with
RoutingStrategies.Tunnel
:
1
target
.
AddHandler
(
InputElement
.
KeyDownEvent
,
OnPreviewKeyDown
,
RoutingStrategies
.
Tunnel
);
2
β
3
void
OnPreviewKeyDown
(
object
sender
,
KeyEventArgs
e
)
4
{
5
// Handler code
6
}
Copied!
Previous
ItemsControl
Next
Class Handlers
Last modified
1yr ago
Export as PDF
Copy link
Edit on GitHub