如何使用 Flex MATE 将 View 的属性绑定到类的属性 [英] How to bind property of View to property of class using Flex MATE

查看:16
本文介绍了如何使用 Flex MATE 将 View 的属性绑定到类的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我发现了 MATE(用于 Flex 开发)并想知道:我如何将视图中的属性(实际上是导航器内容组件)绑定到类中的另一个属性,以便它们保持同步(意味着只要属性在类更改视图中的属性也会更改).

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).

因此,如果我们有一个名为 Target.mxml 的视图和一个属性 targertProp,我们如何将它绑定到名为 SourceClass 的具有属性 SourceProp 的类?

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?

提前致谢

推荐答案

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

当然 SourceProp 必须是 [Bindable]

Of course SourceProp must be [Bindable]

这篇关于如何使用 Flex MATE 将 View 的属性绑定到类的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆