解决Flex TitleWindow无法注入Parsley管理的对象

直接贴代码:
Model:
[Inject]
public var context:Context;

var entityMapping : EntityMapping = new EntityMapping();//componet
//EscapeWindow  extends from TitleWindow
var escapeTw : EscapeWindow = new EscapeWindow(); 
escapeTw.title = "Entity Mapping";
escapeTw.resizable = false;
escapeTw.width = 900;
escapeTw.height = 380;
escapeTw.showCloseButton = true;
escapeTw.addChild(entityMapping);
escapeTw.addEventListener(CloseEvent.CLOSE, closeEntityPopup);
//这个context是在model里面注入的,Parsley 上下文
[b]model.context.viewManager.addViewRoot(escapeTw);[/b]
//第二个参数是指明Top Application
PopUpManager.addPopUp(escapeTw, [b]DisplayObject(Application.application)[/b], true);
PopUpManager.centerPopUp(escapeTw);

你可能感兴趣的:(解决Flex TitleWindow无法注入Parsley管理的对象)