Main页面
This commit is contained in:
1 parent
a003d90b0e
commit
f03e2b08f4
33 files changed
+54543
-34
No files matched your search
@@ -2,8 +2,10 @@
|
||||
using MAX.Common.WPF.Converters;
|
||||
using MAX.Common.WPF.Utilities;
|
||||
using MAX.Core;
|
||||
using MAX.Core.Autofac;
|
||||
using MAX.Framework.Interfaces;
|
||||
using Store.Management.Api;
|
||||
using Store.Management.Framework.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -28,6 +30,31 @@ namespace Store.Management.Framework
|
||||
BaseUrl = new Uri("http://localhost:14312/api/")
|
||||
});
|
||||
builder.Register(_ => client).SingleInstance().PreserveExistingDefaults();
|
||||
|
||||
DISource.Resolver = Resolve;
|
||||
}
|
||||
protected virtual object? Resolve(Type? type, string? name)
|
||||
{
|
||||
if (type == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (IocManager.Container is not null)
|
||||
{
|
||||
if (name != null)
|
||||
{
|
||||
if (IocManager.Container.IsRegisteredWithName(name, type))
|
||||
{
|
||||
return IocManager.Container.ResolveNamed(name, type);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
return IocManager.Resolve(type);
|
||||
}
|
||||
|
||||
return Activator.CreateInstance(type);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user