User Input and Events

At this point, we know how to construct displays and draw items on the display. The next thing we need to consider is how we can get elements on our windows to respond to user input. We saw in Chapter 4 that we can bind methods to hardware events, so that a change of the input level on a pin can cause code to run in our program. Now we need to bind physical hardware events to WPF elements in our program. This is something that the operating system does for us on a larger computer, but on the .NET Micro Framework, it is up to us to decide which input pins correspond to the buttons on our display and then bind each one to the appropriate event for our window elements. This is a two-stage process.

We need to perform the first ...

Get Embedded Programming with the Microsoft® .NET Micro Framework now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.