Concept : Understanding Control Bindings

Page Status: Beta

Back to Concepts and HOW TOs

Contents

[edit] Description

You add controls (View elements such as buttons, edit boxes, checkboxes, etc.) to forms to provide interactivity and feedback between the application and the user.

You bind a control to a class or member of a class (in the Model). In Bungee Connect, the term "bind" is shorthand for the process of assigning the same adapter to both the View and Model elements involved. In the case of control binding, the Bungee Connect machinery assigns the appropriate control adapter to both the Model and the View. With control binding, the term bind is also expanded to include the concept of establising a logical path between the control and the class member to which you want to bind the control. You can bind a control to a class member using either automatic or manual binding:

  • Automatic Binding: The easiest way to attach a control to an object is through automatic binding, which is the type of binding that occurs if you have selected a field or function of a class (accessed in the Solution Explorer or Solution Detail) and then drag a control from the Selection section of the Toolbox onto a form. After you select the class member, the Toolbox automatically changes the content of the Selection section to controls that are appropriate for what you selected in the Solution Details. When you drag the control from the Selection section, the control is automatically bound to the selected class member through the automatic (though not visible) assignment of the same control adapter to both the Model and View elements (the control and the member to which the control is bound), thus enabling runtime binding between the Model and View elements. In addition, the path is also set by the Bungee Connect machinery.
  • Manual Binding:  If you drag a control onto a form from any of the Toolbox sections other than Selection, no matter what you have selected in the Solution Details, you must manually set the Path (available by clicking the red arrow on the upper right of the control). A control adapter is also added by the Bungee Connect machinery  and assigned to the appropriate portion of the Model and the View when you create a manual binding.

    Note Controls found in the Containers section of the Toolbox are not bindable.

[edit] See Also

Binding a Control to an Object
Controls Reference
Understanding Forms

[edit] Tags


Log in if you would like to rate this page.
    Copyright © 2005 - 2007 Bungee Labs. All rights reserved.