Programming Microsoft® Composite UI Application Block and Smart Client Software Factory
by David S. Platt
C. Simplest example
The simplest example of a loosely coupled CAB event is the update of the shell form's main status label, the text on the left side of the status bar at the bottom of the shell form. An application generally contains only one of these, and any piece of code anywhere in the application might reasonably need to use it to convey current status information to the user. Rather than have each piece of code that wants to signal its status need to know the exact implementation of the status label (its name, its class, where and how to get a handle to it, and so on), a much more efficient approach is to expose it as a loosely coupled CAB event.
The code for doing so is shown on the facing page. It is automatically generated by the SCSF ...
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