52 lines
899 B
C#
52 lines
899 B
C#
using Prism.Ioc;
|
|
using Prism.Mvvm;
|
|
using Prism.Services.Dialogs;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using Store.Management.Framework.Extensions;
|
|
using Prism.Autofac;
|
|
|
|
namespace Store.Management.Framework;
|
|
|
|
public abstract class FrameworkApplication : PrismApplication
|
|
{
|
|
|
|
protected FrameworkApplication()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
{
|
|
DISource.Resolver = Resolve;
|
|
base.OnStartup(e);
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
(Container as IContainerExtension).RegisterDialog<DialogWindow>();
|
|
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);
|
|
}
|
|
}
|