Triggering Events on Variable Changes

As discussed in the section called “Event Driven Interaction Model”, events can be generated from many different sources. The Storyboard Engine supports the creation of user events (see Chapter 7, Connecting Events to Actions) and these events can also be generated by the engine when the value of a variable changes. A typical example of where this type of correlated behavior might be applied is to synchronize a scrollbar type presentation with the potion of a scrolling table or layer.

To bind an event to fire when a variable changes you add the event to the variable in the Variables View by selecting the variable you want to bind, right clicking and selecting Bind Event. This will open the standard event selection dialog and allow you to pick (or create) an event to fire when the variable changes.

Similar to screen redraw operations, a new event will not fire every time that a variable's value changes. Instead the first change will cause the event to be queued and until that event is serviced, no subsequent events will be generated. This behavior reflects the intended use of this event generation to allow an efficient coupling of display synchronization to data changes. This functionality should be used with care as overuse of this binding can result in a flood of events and excessive redraw operations.