#206 – WPF Applications Use an Event-Driven Paradigm

WPF uses an event-driven programming model.  In event-driven programs, the user interface elements are first rendered and then the application waits for one or more events to occur.  Events typically originate from the user and normally represent the user interacting with the application through some input device.  For example, a user clicks on a button by clicking with the left mouse button.

When an event occurs, some code in the application executes, in a method known as an event handler.  The application will then typically perform some action in response to the event.  (E.g. open a new window, based on a button being clicked).

Events can also originate from a source other than the user.  For example, an internal software timer might Tick every 100 ms, generating an event for each tick.

Advertisement