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

天涯浪子 提交于 2019-12-23 15:48:45

问题


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


回答1:


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

Of course SourceProp must be [Bindable]




回答2:


For future use: fiction has answered the question correctly.

Actually it should have been formulated this way!




回答3:


Read my article below

http://vinothbabu.com/2010/03/21/introduction-to-mate-framework/

on how you use the Injectors Tag to play with. Its a very simple example. Let me if you were looking for something else.



来源:https://stackoverflow.com/questions/4639128/how-to-bind-property-of-view-to-property-of-class-using-flex-mate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!