/// <summary> /// 处理业务 /// </summary> /// <param name="data"></param> public void HandleFunction(AppModel.Message.FuncMessage data) { AppModel.FuncBase.FuncBase currntFunc = funcIOC.GetInstance <AppModel.FuncBase.FuncBase>(data.Key); //增加子窗体导航 GalaSoft.MvvmLight.Messaging.Messenger.Default.Send <AppModel.FuncBase.FuncBase>(currntFunc); //调用Func的Start方法 currntFunc.Start(); }
/// <summary> /// 注入IOC /// </summary> /// <param name="FuncType"></param> /// <param name="FuncKey"></param> public void RegisterFunction(Type FuncType, string FuncKey) { AppModel.FuncBase.FuncBase temp = System.Activator.CreateInstance(FuncType) as AppModel.FuncBase.FuncBase; funcIOC.Register <AppModel.FuncBase.FuncBase>(() => { return(System.Activator.CreateInstance(FuncType) as AppModel.FuncBase.FuncBase); }, FuncKey, true); }