diff --git a/src/SopHelper.App/App.xaml.cs b/src/SopHelper.App/App.xaml.cs index 58b6896..afc1148 100644 --- a/src/SopHelper.App/App.xaml.cs +++ b/src/SopHelper.App/App.xaml.cs @@ -5,7 +5,11 @@ using System.Windows.Threading; using Prism.Ioc; using Prism.Mvvm; using SopHelper.Core.Prism; +using SopHelper.Engine.Camera; +using SopHelper.Engine.Pipeline; +using SopHelper.Engine.Sop; using SopHelper.Models; +using SopHelper.VVMs.SopPage; using SopHelper.VVMs.MainWindow; namespace SopHelper; @@ -39,6 +43,15 @@ public partial class App } _ = containerRegistry.RegisterSingleton(); + + // 引擎层三件套。它们在 SopHelper.Engine 程序集里,上面的 [Model] 反射扫描只覆盖本程序集, + // 所以必须显式注册,否则 SOP 页 ViewModel 的构造注入解析不出来。 + _ = containerRegistry.RegisterSingleton(); + _ = containerRegistry.RegisterSingleton(); + _ = containerRegistry.RegisterSingleton(); + + // ViewModel 工厂默认走容器解析,带构造注入的 ViewModel 必须先注册 + _ = containerRegistry.Register(); } /// diff --git a/src/SopHelper.App/VVMs/SopPage/SopPage.xaml b/src/SopHelper.App/VVMs/SopPage/SopPage.xaml index 96a901b..e3c8b73 100644 --- a/src/SopHelper.App/VVMs/SopPage/SopPage.xaml +++ b/src/SopHelper.App/VVMs/SopPage/SopPage.xaml @@ -2,13 +2,263 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:prism="http://prismlibrary.com/" - prism:ViewModelLocator.AutoWireViewModel="True"> + prism:ViewModelLocator.AutoWireViewModel="True" + Background="{StaticResource Bg}"> - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +