简体   繁体   English

配合PropertyInjectors-注入到as3类吗?

[英]Mate PropertyInjectors - Inject to as3 class?

Does anyone know if it is possible to inject into a regular as3 (non mxml) class? 有谁知道是否可以注入常规的as3(非mxml)类? I've tried with limited success. 我尝试的成功有限。 Thanks 谢谢

Could you be more specific? 你可以再详细一点吗? There's no difference between an "MXML" class and a class defined in ActionScript, it's just different ways of writing the same thing. “ MXML”类与ActionScript中定义的类之间没有什么区别,只是编写相同内容的方式不同。

All that is needed for injection to work is a source property that is bindable and a destination property that is public (either a public setter or a public instance variable). 注入工作所需要做的就是可绑定的源属性和公共的目标属性(公共设置器或公共实例变量)。 If those two requirements are met and the code compiles it should work. 如果满足了这两个要求,并且代码可以编译,则可以正常工作。

Look at the code for the example application you can find here: http://code.google.com/p/mate-examples/wiki/DocumentBasedExampleIntro and you will find a ton of injectors that target classes not defined using MXML (look for injectors targeting classes whose names end in "Model" especially). 查看示例应用程序的代码,您可以在这里找到: http : //code.google.com/p/mate-examples/wiki/DocumentBasedExampleIntro ,您会发现大量的注入器针对未使用MXML定义的类。以名称以“模型”结尾的类为目标的注入器)。 You can also find countless examples in the Mate forums . 您还可以在Mate论坛中找到无数的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM