apache-flexbindingmate

How to bind property of View to property of class using Flex MATE


Lately i discovered MATE (for Flex development) and was wondering: how do i bind a property in a view (actually a navigatorcontent component) to another property in a class so that they stay in synchronization (meaning that whenever the property in the class changes the property in the view also changes).

So if we have a view called Target.mxml and a property targertProp how do we bind it to the class called SourceClass with property SourceProp?

Thanks in advance


Solution

  • <Injectors target="{Target}">
       <PropertyInjector targetKey="targertProp" 
                         source="{SourceClass}"
                         sourceKey="SourceProp"/>
    </Injectors>
    

    Of course SourceProp must be [Bindable]