FunctionZero
  • Libraries
    • Maui.MvvmZero
      • Overview
      • Quickstart
      • Walkthrough
        • Create your application
        • Create your ContentPages
        • Create your ViewModels
        • Register your new content
        • Launching our app!
        • Adding Navigation
        • Summary
      • Recommended naming conventions
      • Configuring your root Page
        • Root ContentPage
        • Root NavigationPage
        • Root TabbedPage
        • Root FlyoutPage
      • A note on Singleton vs Transient
      • Recommended base classes for PageViewModels and ViewModels
    • Maui.Controls
      • ExpanderZero
      • FocusScrollZero
      • LabelZero
      • ListViewZero
      • MaskZero
      • MultiViewZero
      • TreeViewZero
    • CommandZero
    • Maui.BindZero
      • Quickstart
      • z:Bind
      • Examples
      • The Great Escape
      • Casting
      • Short Circuit
      • Errors
      • Aliases
      • Value types and Reference types
      • z:Function
      • z:TapTrigger
      • z:EdgeTrigger
      • z:Latch
      • Advanced Usage - Functions, aliases and operator-overloads
    • AnimationZero
    • LocalisationZero
Powered by GitBook
On this page
  1. Libraries
  2. Maui.BindZero

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

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

Sample Expression
Source
Notes

{z:Bind Count}

BindingContext

Bind to Count, same as Binding

{z:Bind Count * 2}

BindingContext

Bind to an expression that yields Count * 2

{z:Bind '(Delta.X &lt; 0.2) &amp;&amp; (Delta.X &gt; -0.2)' }

BindingContext

True if (Delta.X < 0.2) && (Delta.X > -0.2)

{z:Bind '(Delta.X LT 0.2) AND (Delta.X GT -0.2)' }

BindingContext

As above, using aliases instead of escape-sequences

{z:Bind (Count * 2) LT 10}

BindingContext

True if (Count * 2) < 10

{z:Bind Sin(Count / 25.0)}

BindingContext

Calls a function (see below)

{z:Bind 'Value LT 0.2', Source={x:Reference MySlider}}

An Element called MySlider

True if MySlider.Value < 0.2

PreviousQuickstartNextExamples

Last updated 1 year ago