Binding contexts are a hierarchical structure of special objects that help you make logical scopes for the control flow bindings. Each such binding (such as
with, and so on) generates its own binding context in the hierarchy. You can think of contexts as a scoped wrapper of a ViewModel. For example, the root binding context refers to your main ViewModel. You can work with contexts with the help of special properties that are listed as follows. The best way to understand the binding context concept is to look at some examples. Let's do it.
$parent: This refers to the ViewModel of the parent binding context. For example, say you have the
foreachbinding to the book collection, but want to use the name of the library ...