This commit is contained in:
2025-12-17 14:58:09 +08:00
parent 325b24c99f
commit 51e4d5add4
5 changed files with 434 additions and 31 deletions

View File

@@ -62,7 +62,12 @@ namespace OrpaonEMS.App
/// </summary>
private EnergyStorageService energyStorageService { get; set; }
protected override Window CreateShell() => null;
protected override Window CreateShell()
{
var container = ContainerLocator.Container;
var shell = container.Resolve<object>("MainWindow");
return shell as Window;
}
protected override void RegisterTypes(IContainerRegistry services)
{
@@ -130,8 +135,8 @@ namespace OrpaonEMS.App
{
//从容器中获取MainView的实例对象
var container = ContainerLocator.Container;
var shell = container.Resolve<object>("MainWindow");
if (shell is Window view)
var view = Application.Current.MainWindow as Window;
if (view != null)
{
//更新Prism注册区域信息
var regionManager = container.Resolve<IRegionManager>();