Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

APPENDIX: The Visage Language in Depth > Working with Data Bindings

Working with Data Bindings

Visage’s data binding facility allows any variable to be bound to a value expression. When any constituent part of the bound expression is changed, the bound expression is recalculated and the variable’s value is also changed. The data binding capability is at the center of the Visage approach for GUI development, in which onscreen UI controls’ properties are bound to a model object and the GUI is controlled through state changes in the model object.

Bind Expression

A bind expression is introduced by the bind keyword, followed by a value expression and optionally the with inverse keywords. Bind expressions are automatically reevaluated when their dependencies change. Unlike all the other expressions that you’ve learned so far, bind expressions are not true stand-alone expressions. A bind expression must appear on the right-hand side of constant declarations, variable declarations, or instance variable initializers in object literal expressions. It also puts restrictions on the value expression that appears on its right-hand side. The constant, variable, or instance variable is said to be bound to the expression.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial