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

Quickstart

Setup

  1. Use the package manager to add the Nuget package FunctionZero.Maui.zBind

  2. Add a namespace alias to your xaml, like this:

xmlns:z="clr-namespace:FunctionZero.Maui.zBind.z;assembly=FunctionZero.Maui.zBind"

z:Bind - animate an Image based on 'Count' in your ViewModel

<Image Source="dotnet_bot.png"
       TranslationX="{z:Bind Sin(Count / 25.0) * 100}"
       TranslationY="{z:Bind Cos(Count / 15.0) * 100}"
       Rotation="{z:Bind Sin(Count / 5.0) * 20}"
/>

z:TapTrigger - modify a ViewModel property when tapped ...

<Button Text="Reset 'Count' in the ViewModel">
    <Button.Behaviors>
        <z:TapTrigger TapAction="{z:Function 'Count = 0'}"/>
    </Button.Behaviors>
</Button>

z:EdgeTrigger - when a Condition changes, execute a Rising or Falling Expression ...

<ContentPage.Behaviors>
    <z:EdgeTrigger 
        Condition="{z:Bind '(Value LT 0.5)', Source={x:Reference TheSlider}}" 
        Rising="{z:Function 'RotationY = 90', Source={x:Reference TheImage}}"
        Falling="{z:Function 'RotationY = 180', Source={x:Reference TheImage}}" />
</ContentPage.Behaviors>
PreviousMaui.BindZeroNextz:Bind

Last updated 1 year ago