50 lines
778 B
C#
50 lines
778 B
C#
using Prism.Autofac;
|
|
using Prism.Ioc;
|
|
using Prism.Mvvm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using Trade.Framework.Extensions;
|
|
|
|
namespace Trade.Framework;
|
|
|
|
public abstract class FrameworkApplication : PrismApplication
|
|
{
|
|
|
|
protected FrameworkApplication()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
{
|
|
DISource.Resolver = Resolve;
|
|
base.OnStartup(e);
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
base.OnInitialized();
|
|
}
|
|
|
|
|
|
private object Resolve(Type type, string name)
|
|
{
|
|
if (type == null || Container is null)
|
|
{
|
|
return null;
|
|
}
|
|
|
|
if (name != null)
|
|
{
|
|
return Container.Resolve(type, name);
|
|
}
|
|
|
|
return Container.Resolve(type);
|
|
}
|
|
}
|