我有一个PresentationModel
AS 类,其中包含SomeView.mxml
. 模型的整个类都是可绑定的,视图中的模型属性也是可绑定的。但是,我无法使用PropertyInjector
标签将模型注入到视图中:
- INFO: Data binding will not be able to detect assignments to model
熟悉 Flex 数据绑定和 Mate 的人可以帮帮我吗?非常感谢!
MainEventMap.mxml
<EventHandlers type="{FlexEvent.INITIALIZE}">
<ObjectBuilder generator="{PresentationModel}" registerTarget="true">
<Properties dispatcher="{scope.dispatcher}"/>
</ObjectBuilder>
</EventHandlers>
<Injectors target="{SomeView}" debug="true">
<PropertyInjector targetKey="model" source="{PresentationModel}" />
</Injectors>
片段来自PresentationModel.as
[Bindable]
public class PresentationModel extends EventDispatcher
{
public var dispatcher:IEventDispatcher;
//.....other variables and functions
}
片段来自SomeView.mxml
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="518" height="562" >
<mx:Script>
<![CDATA[
//...... all the imports
[Bindable]
public var model:OSGiBrokerConsoleModel;
// ......other variables and functions
]]>
</mx:Script>
// ..... actual view components
</mx:Canvas>