Windows Presentation Foundation: 3 Events and the Event Model
1h 48mIntermediate2016-12-10
Authors

Walt Ritscher
Programmer, UI Designer, Staff Instructor at LinkedIn Learning
Course details
Windows Presentation Foundation (WPF) in Visual Studio 2015 helps developers build modern desktop applications for Windows. The event model is WPF's new system for monitoring and reacting to application events and user-triggered events like keyboard and mouse input. It greatly improves on the .NET event model, and is an important skill for any developer who wants to create rich Windows user experiences. Join expert developer Walt Ritscher as he steps you through the details of working with events in WPF. Learn how routing works and discover how to navigate up the tree (with event bubbling) and down the tree (with event tunneling)—and stop events from moving at all with event suppression. Then follow along with Walt as he explores many sample events, including mouse, text, and keyboard events and gesture events on the InkCanvas.
Learning objectives
Recognize routed events.
Explain event signatures.
Determine how to wire up event handlers.
Define event bubbling and event tunneling.
Break down how to program mouse events.
Show how to program keyboard and ink events.
Learning objectives
Recognize routed events.
Explain event signatures.
Determine how to wire up event handlers.
Define event bubbling and event tunneling.
Break down how to program mouse events.
Show how to program keyboard and ink events.
Skills covered
Visual StudioClient Operating SystemsWindowsIT Help DeskMicrosoftDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Welcome
- 02 - What you should know before watching
- 03 - Disable the WPF debugging tool
- 04 - Using the exercise files
1. Understand the Event Model
- 05 - Understand routed events
- 06 - Understand event signatures
- 07 - Understand the RoutedEventArgs
- 08 - Wire up event handlers in XAML
- 09 - Wire up event handlers with the Properties window
- 10 - Wire up event handers in code
- 11 - Understand event bubbling
- 12 - Understand event tunneling
- 13 - Suppress events as they traverse the element tree
2. Mouse Events
- 14 - The MouseEnter and MouseLeave events
- 15 - Use the MouseWheel event
- 16 - Use the MouseMove event
- 17 - Set the mouse cursor
- 18 - Start a drag operation
- 19 - Use DragEnter to indicate a valid drag target
- 20 - Use the Drop event to complete the drag drop operation
- 21 - Use formats to send different data to the drop target
3. Keyboard and Ink Events
- 22 - Use the TextChanged event
- 23 - Use the KeyUp event
- 24 - Use TextInput event to block user input
- 25 - Use the InkCanvas
- 26 - Use the Gesture event
Conclusion
- 27 - Next steps