Mate PropertyInjectors - 注入到 as3 类?
有谁知道是否可以注入常规 as3 (非 mxml)类? 我尝试过,但成效有限。 谢谢
Does anyone know if it is possible to inject into a regular as3 (non mxml) class? I've tried with limited success.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以再详细一点吗? “MXML”类和 ActionScript 中定义的类没有区别,只是编写相同内容的不同方式。
注入工作所需的只是可绑定的源属性和公共的目标属性(公共 setter 或公共实例变量)。 如果满足这两个要求并且代码可以编译,那么它应该可以工作。
查看示例应用程序的代码,您可以在此处找到:http://code .google.com/p/mate-examples/wiki/DocumentBasedExampleIntro,您会发现大量针对未使用 MXML 定义的类的注入器(尤其是查找针对名称以“Model”结尾的类的注入器)。 您还可以在 Mate 论坛 中找到无数示例。
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.
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). You can also find countless examples in the Mate forums.