public void Inject(object obj, object[] args, IRuntimeImportContext ctx) { var tree = new ActivatorTree(null, ctx.StaticContext); tree.Key = new ActivatorKey(obj.GetType(), null); var injectors = GetClassInjector(tree); injectors.Item1(ctx, args, obj); injectors.Item2(ctx, args, obj); }
public T GetTarget <T>() { IRuntimeImportContext ctx = this; while (ctx != null) { if (ctx.Target is T r) { return(r); } ctx = ctx.Parent; } return(default(T)); }
public void Initialize(IRuntimeImportContext ctx, object[] args) { }
public void Initialize(IRuntimeImportContext ctx, object[] args) { Mvvm = ctx.GetTarget <IMvvmService>(); }
public object Locate(IRuntimeImportContext ctx, object[] args = null) => GetLocator(new ActivatorTree(null, ctx.StaticContext))(ctx, args);
public void Initialize(IRuntimeImportContext ctx, object[] args) { var target = ctx.GetTarget <TClass>(); _target = new WeakReference <TClass>(target); }
protected RuntimeImportContext(IRuntimeImportContext parent, IImportContext ctx) { Parent = parent; StaticContext = ctx; Target = parent?.Target; }