Handling Events in WPF
You handle events in WPF the same way you do in other kinds of applications: You code a Visual Basic event handler and associate the handler to a control event. What actually changes is the way you assign the handler to the event. For example you can assign an event handler to a control event directly within the XAML code editor. To accomplish this you simply type the name of the event you want to handle (events are recognizable within IntelliSense with the Lightning icon) and then press Tab when IntelliSense shows the <New Event Handler> pop-up command (see Figure 31.11 for details).
Figure 31.11 Generating a new event handler with IntelliSense.
This generates an event handler stub in your code-behind file. Continuing ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access