Files
29WxOrder/Source/MAX.Framework/PrismExtension/Prism.Autofac/PrismApplication.cs
T
2026-08-31 16:28:23 +08:00

45 lines
1.2 KiB
C#

using Prism.Ioc;
using System;
using System.Windows;
using AutofacCore = Autofac.Core;
namespace Prism.Autofac
{
/// <summary>
/// Base application class that uses <see cref="UnityContainerExtension"/> as it's container.
/// </summary>
public abstract class PrismApplication : PrismApplicationBase
{
/// <summary>
/// Create a new <see cref="UnityContainerExtension"/> used by Prism.
/// </summary>
/// <returns>A new <see cref="UnityContainerExtension"/>.</returns>
protected override IContainerExtension CreateContainerExtension()
{
return new AutofacContainerExtension();
}
/// <summary>
/// Registers the <see cref="Type"/>s of the Exceptions that are not considered
/// root exceptions by the <see cref="ExceptionExtensions"/>.
/// </summary>
protected override void RegisterFrameworkExceptionTypes()
{
ExceptionExtensions.RegisterFrameworkExceptionType(typeof(AutofacCore.DependencyResolutionException));
ExceptionExtensions.RegisterFrameworkExceptionType(typeof(AutofacCore.Registration.ComponentNotRegisteredException));
}
protected override void Initialize()
{
base.Initialize();
}
protected override Window CreateShell()
{
return null;
}
}
}