# z:Bind

Used to DataBind to an *Expression*. If the *Expression* is just a property-name then it is equivalent to `Binding`\
A `z:Bind` automatically updates if any referenced properties notify they have changed

#### Usage

```markup
TargetProperty = { z:Bind <some expression> [, Source=<some source>] }
```

#### Source property

Just like a standard `Binding`, the *data-source* is the current *BindingContext*, unless `Source` is specified.\
If this *data-source* supports `INotifyPropertyChanged`, changes will be tracked.

#### z:Bind Expressions

<table data-full-width="true"><thead><tr><th width="378.3333333333333">Sample Expression</th><th width="151" align="center">Source</th><th>Notes</th></tr></thead><tbody><tr><td><code>{z:Bind Count}</code></td><td align="center">BindingContext</td><td>Bind to <code>Count</code>, same as <code>Binding</code></td></tr><tr><td><code>{z:Bind Count * 2}</code></td><td align="center">BindingContext</td><td>Bind to an expression that yields Count * 2</td></tr><tr><td><code>{z:Bind '(Delta.X &#x26;lt; 0.2) &#x26;amp;&#x26;amp; (Delta.X &#x26;gt; -0.2)' }</code></td><td align="center">BindingContext</td><td>True if (Delta.X &#x3C; 0.2) &#x26;&#x26; (Delta.X > -0.2)</td></tr><tr><td><code>{z:Bind '(Delta.X LT 0.2) AND (Delta.X GT -0.2)' }</code></td><td align="center">BindingContext</td><td>As above, using <em>aliases</em> instead of escape-sequences</td></tr><tr><td><code>{z:Bind (Count * 2) LT 10}</code></td><td align="center">BindingContext</td><td>True if (Count * 2) &#x3C; 10</td></tr><tr><td><code>{z:Bind Sin(Count / 25.0)}</code></td><td align="center">BindingContext</td><td>Calls a <em>function</em> (see below)</td></tr><tr><td><code>{z:Bind 'Value LT 0.2', Source={x:Reference MySlider}}</code></td><td align="center">An <em>Element</em> called MySlider</td><td>True if <code>MySlider.Value</code> &#x3C; 0.2</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://functionzero.gitbook.io/docs/libraries/maui.bindzero/z-bind.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
