From 726eb6de16a09f14067a28e2ab4dd4f62544a015 Mon Sep 17 00:00:00 2001 From: chfei Date: Mon, 31 Aug 2026 16:28:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Prism=20=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 29WxOrder.sln | 92 ++ Directory.Build.props | 24 + Main.Test/App.xaml | 8 + Main.Test/App.xaml.cs | 57 + Main.Test/AssemblyInfo.cs | 10 + Main.Test/Main.Test.csproj | 24 + Main.Test/MainWindow.xaml | 19 + Main.Test/MainWindow.xaml.cs | 22 + Main.Test/ViewModels/HeaderViewModel.cs | 30 + Main.Test/ViewModels/MainViewModel.cs | 20 + Main.Test/Views/HeaderView.xaml | 16 + Main.Test/Views/HeaderView.xaml.cs | 27 + Main.Test/Views/bbbDialogView.xaml | 12 + Main.Test/Views/bbbDialogView.xaml.cs | 57 + Source/MAX.Core/Autofac/AutowiredAttribute.cs | 12 + .../Autofac/CustomPropertySelector.cs | 23 + .../MAX.Core/Autofac/IDependencyRegistrar.cs | 9 + Source/MAX.Core/Autofac/IocManager.cs | 107 ++ Source/MAX.Core/Caches/ICache.cs | 99 ++ Source/MAX.Core/Caches/MemoryCache.cs | 168 ++ Source/MAX.Core/Commons/CommonValue.cs | 37 + Source/MAX.Core/Commons/Result.cs | 55 + Source/MAX.Core/Cryptography/Base64Helper.cs | 69 + Source/MAX.Core/Cryptography/DESHelper.cs | 215 +++ Source/MAX.Core/Cryptography/MD5Helper.cs | 62 + Source/MAX.Core/Cryptography/UrlHelper.cs | 51 + .../DependencyInjection/IScopedDependency.cs | 8 + .../DependencyInjection/IServiceRegistrar.cs | 81 + .../ISingletonDependency.cs | 8 + .../ITransientDependency.cs | 8 + .../LazyServiceProvider.cs | 36 + Source/MAX.Core/Extensions/Convert.cs | 218 +++ .../Extensions/DictionaryExtension.cs | 33 + Source/MAX.Core/Helpers/Common.cs | 55 + Source/MAX.Core/Helpers/CommonItem.cs | 78 + Source/MAX.Core/Helpers/Convert.cs | 385 +++++ Source/MAX.Core/Helpers/CopyHelper.cs | 1151 ++++++++++++++ Source/MAX.Core/Helpers/DateHelper.cs | 110 ++ Source/MAX.Core/Helpers/EnumHelper.cs | 341 ++++ Source/MAX.Core/Helpers/EnvironmentHelper.cs | 71 + Source/MAX.Core/Helpers/FileHelper.cs | 188 +++ Source/MAX.Core/Helpers/HttpHelper.cs | 1047 +++++++++++++ Source/MAX.Core/Helpers/IdHelper.cs | 45 + Source/MAX.Core/Helpers/ParametersBase.cs | 369 +++++ Source/MAX.Core/Helpers/ReflectionHelper.cs | 586 +++++++ Source/MAX.Core/Helpers/UriHelper.cs | 149 ++ Source/MAX.Core/Infrastructure/IStartup.cs | 15 + .../MAX.Core/Infrastructure/SingleInstance.cs | 42 + Source/MAX.Core/IntPriority.cs | 74 + Source/MAX.Core/Logger/ConsoleLogger.cs | 124 ++ Source/MAX.Core/Logger/ICustomLogger.cs | 12 + Source/MAX.Core/Logger/ILoggerFacade.cs | 68 + Source/MAX.Core/Logger/LogLevel.cs | 15 + Source/MAX.Core/MAX.Core.csproj | 12 + Source/MAX.Core/Reflections/AppTypeFinder.cs | 197 +++ Source/MAX.Core/Reflections/Finder.cs | 129 ++ Source/MAX.Core/Startup.cs | 46 + Source/MAX.Framework/Commons/KeyValue.cs | 35 + Source/MAX.Framework/Configs/ConfigBase.cs | 46 + Source/MAX.Framework/Configs/GlobalConfig.cs | 28 + .../MAX.Framework/Helpers/AppConfigHelper.cs | 156 ++ Source/MAX.Framework/Helpers/ConfigHelper.cs | 74 + Source/MAX.Framework/Helpers/FileHelper.cs | 181 +++ Source/MAX.Framework/Helpers/ImageBuild.cs | 1071 +++++++++++++ Source/MAX.Framework/Helpers/ObjectHelper.cs | 77 + .../MAX.Framework/Helpers/StringTypeHelper.cs | 144 ++ Source/MAX.Framework/Helpers/WinCmdHelper.cs | 157 ++ Source/MAX.Framework/Helpers/XmlHelper.cs | 292 ++++ Source/MAX.Framework/Interfaces/IAppConfig.cs | 17 + .../Interfaces/IAppInitialize.cs | 38 + .../MAX.Framework/Interfaces/IFolderConfig.cs | 20 + Source/MAX.Framework/Logger/NLogger.cs | 153 ++ Source/MAX.Framework/MAX.Framework.csproj | 18 + .../Commands/AsyncDelegateCommand.cs | 243 +++ .../Commands/AsyncDelegateCommand{T}.cs | 284 ++++ .../PrismExtension/Commands/IAsyncCommand.cs | 28 + .../AutofacContainerExtension.cs | 334 ++++ .../IAutofacContainerExtension.cs | 16 + .../Prism.Autofac/IPreRegisterTypes.cs | 9 + .../Prism.Autofac/PrismApplication.cs | 44 + .../Prism.Autofac/PrismBootstrapper.cs | 31 + .../Prism.Autofac/PrismIocExtensions.cs | 40 + .../PrismExtension/RegionManagerExtension.cs | 35 + Source/MAX.Framework/Startup.cs | 61 + Source/Trade.Client/APIs/CommonApi.cs | 90 ++ Source/Trade.Client/Helpers/HttpHelper.cs | 1395 +++++++++++++++++ .../HttpExtension/ServerReqeustBase.cs | 94 ++ Source/Trade.Client/IServerConfig.cs | 16 + Source/Trade.Client/ServerConfig.cs | 21 + Source/Trade.Client/Startup.cs | 63 + Source/Trade.Client/Trade.Client.csproj | 15 + Source/Trade.Framework/AssemblyInfo.cs | 8 + .../Controls/UserControlBase.cs | 17 + Source/Trade.Framework/Controls/WindowBase.cs | 17 + Source/Trade.Framework/Extensions/DISource.cs | 21 + .../Trade.Framework/FrameworkApplication.cs | 49 + .../Trade.Framework/Services/UserManager.cs | 21 + Source/Trade.Framework/Startup.cs | 25 + Source/Trade.Framework/Trade.Framework.csproj | 17 + 99 files changed, 12527 insertions(+) create mode 100644 Directory.Build.props create mode 100644 Main.Test/App.xaml create mode 100644 Main.Test/App.xaml.cs create mode 100644 Main.Test/AssemblyInfo.cs create mode 100644 Main.Test/Main.Test.csproj create mode 100644 Main.Test/MainWindow.xaml create mode 100644 Main.Test/MainWindow.xaml.cs create mode 100644 Main.Test/ViewModels/HeaderViewModel.cs create mode 100644 Main.Test/ViewModels/MainViewModel.cs create mode 100644 Main.Test/Views/HeaderView.xaml create mode 100644 Main.Test/Views/HeaderView.xaml.cs create mode 100644 Main.Test/Views/bbbDialogView.xaml create mode 100644 Main.Test/Views/bbbDialogView.xaml.cs create mode 100644 Source/MAX.Core/Autofac/AutowiredAttribute.cs create mode 100644 Source/MAX.Core/Autofac/CustomPropertySelector.cs create mode 100644 Source/MAX.Core/Autofac/IDependencyRegistrar.cs create mode 100644 Source/MAX.Core/Autofac/IocManager.cs create mode 100644 Source/MAX.Core/Caches/ICache.cs create mode 100644 Source/MAX.Core/Caches/MemoryCache.cs create mode 100644 Source/MAX.Core/Commons/CommonValue.cs create mode 100644 Source/MAX.Core/Commons/Result.cs create mode 100644 Source/MAX.Core/Cryptography/Base64Helper.cs create mode 100644 Source/MAX.Core/Cryptography/DESHelper.cs create mode 100644 Source/MAX.Core/Cryptography/MD5Helper.cs create mode 100644 Source/MAX.Core/Cryptography/UrlHelper.cs create mode 100644 Source/MAX.Core/DependencyInjection/IScopedDependency.cs create mode 100644 Source/MAX.Core/DependencyInjection/IServiceRegistrar.cs create mode 100644 Source/MAX.Core/DependencyInjection/ISingletonDependency.cs create mode 100644 Source/MAX.Core/DependencyInjection/ITransientDependency.cs create mode 100644 Source/MAX.Core/DependencyInjection/LazyServiceProvider.cs create mode 100644 Source/MAX.Core/Extensions/Convert.cs create mode 100644 Source/MAX.Core/Extensions/DictionaryExtension.cs create mode 100644 Source/MAX.Core/Helpers/Common.cs create mode 100644 Source/MAX.Core/Helpers/CommonItem.cs create mode 100644 Source/MAX.Core/Helpers/Convert.cs create mode 100644 Source/MAX.Core/Helpers/CopyHelper.cs create mode 100644 Source/MAX.Core/Helpers/DateHelper.cs create mode 100644 Source/MAX.Core/Helpers/EnumHelper.cs create mode 100644 Source/MAX.Core/Helpers/EnvironmentHelper.cs create mode 100644 Source/MAX.Core/Helpers/FileHelper.cs create mode 100644 Source/MAX.Core/Helpers/HttpHelper.cs create mode 100644 Source/MAX.Core/Helpers/IdHelper.cs create mode 100644 Source/MAX.Core/Helpers/ParametersBase.cs create mode 100644 Source/MAX.Core/Helpers/ReflectionHelper.cs create mode 100644 Source/MAX.Core/Helpers/UriHelper.cs create mode 100644 Source/MAX.Core/Infrastructure/IStartup.cs create mode 100644 Source/MAX.Core/Infrastructure/SingleInstance.cs create mode 100644 Source/MAX.Core/IntPriority.cs create mode 100644 Source/MAX.Core/Logger/ConsoleLogger.cs create mode 100644 Source/MAX.Core/Logger/ICustomLogger.cs create mode 100644 Source/MAX.Core/Logger/ILoggerFacade.cs create mode 100644 Source/MAX.Core/Logger/LogLevel.cs create mode 100644 Source/MAX.Core/MAX.Core.csproj create mode 100644 Source/MAX.Core/Reflections/AppTypeFinder.cs create mode 100644 Source/MAX.Core/Reflections/Finder.cs create mode 100644 Source/MAX.Core/Startup.cs create mode 100644 Source/MAX.Framework/Commons/KeyValue.cs create mode 100644 Source/MAX.Framework/Configs/ConfigBase.cs create mode 100644 Source/MAX.Framework/Configs/GlobalConfig.cs create mode 100644 Source/MAX.Framework/Helpers/AppConfigHelper.cs create mode 100644 Source/MAX.Framework/Helpers/ConfigHelper.cs create mode 100644 Source/MAX.Framework/Helpers/FileHelper.cs create mode 100644 Source/MAX.Framework/Helpers/ImageBuild.cs create mode 100644 Source/MAX.Framework/Helpers/ObjectHelper.cs create mode 100644 Source/MAX.Framework/Helpers/StringTypeHelper.cs create mode 100644 Source/MAX.Framework/Helpers/WinCmdHelper.cs create mode 100644 Source/MAX.Framework/Helpers/XmlHelper.cs create mode 100644 Source/MAX.Framework/Interfaces/IAppConfig.cs create mode 100644 Source/MAX.Framework/Interfaces/IAppInitialize.cs create mode 100644 Source/MAX.Framework/Interfaces/IFolderConfig.cs create mode 100644 Source/MAX.Framework/Logger/NLogger.cs create mode 100644 Source/MAX.Framework/MAX.Framework.csproj create mode 100644 Source/MAX.Framework/PrismExtension/Commands/AsyncDelegateCommand.cs create mode 100644 Source/MAX.Framework/PrismExtension/Commands/AsyncDelegateCommand{T}.cs create mode 100644 Source/MAX.Framework/PrismExtension/Commands/IAsyncCommand.cs create mode 100644 Source/MAX.Framework/PrismExtension/Prism.Autofac/AutofacContainerExtension.cs create mode 100644 Source/MAX.Framework/PrismExtension/Prism.Autofac/IAutofacContainerExtension.cs create mode 100644 Source/MAX.Framework/PrismExtension/Prism.Autofac/IPreRegisterTypes.cs create mode 100644 Source/MAX.Framework/PrismExtension/Prism.Autofac/PrismApplication.cs create mode 100644 Source/MAX.Framework/PrismExtension/Prism.Autofac/PrismBootstrapper.cs create mode 100644 Source/MAX.Framework/PrismExtension/Prism.Autofac/PrismIocExtensions.cs create mode 100644 Source/MAX.Framework/PrismExtension/RegionManagerExtension.cs create mode 100644 Source/MAX.Framework/Startup.cs create mode 100644 Source/Trade.Client/APIs/CommonApi.cs create mode 100644 Source/Trade.Client/Helpers/HttpHelper.cs create mode 100644 Source/Trade.Client/HttpExtension/ServerReqeustBase.cs create mode 100644 Source/Trade.Client/IServerConfig.cs create mode 100644 Source/Trade.Client/ServerConfig.cs create mode 100644 Source/Trade.Client/Startup.cs create mode 100644 Source/Trade.Client/Trade.Client.csproj create mode 100644 Source/Trade.Framework/AssemblyInfo.cs create mode 100644 Source/Trade.Framework/Controls/UserControlBase.cs create mode 100644 Source/Trade.Framework/Controls/WindowBase.cs create mode 100644 Source/Trade.Framework/Extensions/DISource.cs create mode 100644 Source/Trade.Framework/FrameworkApplication.cs create mode 100644 Source/Trade.Framework/Services/UserManager.cs create mode 100644 Source/Trade.Framework/Startup.cs create mode 100644 Source/Trade.Framework/Trade.Framework.csproj diff --git a/29WxOrder.sln b/29WxOrder.sln index cbb0fa1..2b5b26e 100644 --- a/29WxOrder.sln +++ b/29WxOrder.sln @@ -17,6 +17,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_SolutionItems", "_Solution ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig .gitignore = .gitignore + Directory.Build.props = Directory.Build.props EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WxOrder.Framework", "WxOrder.Framework\WxOrder.Framework.csproj", "{3123963C-A0EC-4AD5-9916-DC063F73490B}" @@ -25,6 +26,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".test", ".test", "{14261B9B EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WXOrder.Test", "test\WXOrder.Test\WXOrder.Test.csproj", "{3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trade.Client", "Source\Trade.Client\Trade.Client.csproj", "{BCABF48D-183D-A66F-33B6-B865CC0AD623}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MAX.Core", "Source\MAX.Core\MAX.Core.csproj", "{313C8137-00DA-4116-B3B4-68FC45CC0CE7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trade.Framework", "Source\Trade.Framework\Trade.Framework.csproj", "{0180FDFA-6984-462D-B406-65B460CDB47A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Main.Test", "Main.Test\Main.Test.csproj", "{890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MAX.Framework", "Source\MAX.Framework\MAX.Framework.csproj", "{EABFACFE-C74D-4111-9683-C6E7714F432D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -117,6 +128,86 @@ Global {3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}.Release|x64.Build.0 = Release|Any CPU {3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}.Release|x86.ActiveCfg = Release|Any CPU {3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7}.Release|x86.Build.0 = Release|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x64.ActiveCfg = Debug|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x64.Build.0 = Debug|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x86.ActiveCfg = Debug|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Debug|x86.Build.0 = Debug|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Any CPU.Build.0 = Release|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x64.ActiveCfg = Release|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x64.Build.0 = Release|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x86.ActiveCfg = Release|Any CPU + {BCABF48D-183D-A66F-33B6-B865CC0AD623}.Release|x86.Build.0 = Release|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|x64.ActiveCfg = Debug|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|x64.Build.0 = Debug|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|x86.ActiveCfg = Debug|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Debug|x86.Build.0 = Debug|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|Any CPU.Build.0 = Release|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|x64.ActiveCfg = Release|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|x64.Build.0 = Release|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|x86.ActiveCfg = Release|Any CPU + {313C8137-00DA-4116-B3B4-68FC45CC0CE7}.Release|x86.Build.0 = Release|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|x64.ActiveCfg = Debug|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|x64.Build.0 = Debug|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|x86.ActiveCfg = Debug|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Debug|x86.Build.0 = Debug|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Release|Any CPU.Build.0 = Release|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Release|x64.ActiveCfg = Release|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Release|x64.Build.0 = Release|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Release|x86.ActiveCfg = Release|Any CPU + {0180FDFA-6984-462D-B406-65B460CDB47A}.Release|x86.Build.0 = Release|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|x64.ActiveCfg = Debug|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|x64.Build.0 = Debug|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|x86.ActiveCfg = Debug|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Debug|x86.Build.0 = Debug|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|Any CPU.Build.0 = Release|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|x64.ActiveCfg = Release|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|x64.Build.0 = Release|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|x86.ActiveCfg = Release|Any CPU + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF}.Release|x86.Build.0 = Release|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|x64.ActiveCfg = Debug|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|x64.Build.0 = Debug|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|x86.ActiveCfg = Debug|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Debug|x86.Build.0 = Debug|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|Any CPU.Build.0 = Release|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|x64.ActiveCfg = Release|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|x64.Build.0 = Release|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|x86.ActiveCfg = Release|Any CPU + {EABFACFE-C74D-4111-9683-C6E7714F432D}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -126,6 +217,7 @@ Global {1AD45D66-6872-4522-ACF0-04E2C0514048} = {4A54DC2A-B47C-4ED1-A482-EE60161DB2C3} {5A410EB5-06AD-97BB-2314-9D7A808E12F7} = {1A7830FA-AC8F-40FB-A232-F0626812B8BE} {3790EC79-EA1D-4660-AB0D-EA0DE4FF77B7} = {14261B9B-E3EA-4BC0-B08D-4B3591AC13E5} + {890E871A-F6E7-42DA-85D5-3BF2F8ECAEDF} = {14261B9B-E3EA-4BC0-B08D-4B3591AC13E5} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {38687A61-0347-49AC-98C7-E7F7148C0234} diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 0000000..b60289c --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,24 @@ + + + + + net8.0 + $(DefaultTargetFramework) + 12.0 + true + false + true + annotations + CS1591 + enable + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + diff --git a/Main.Test/App.xaml b/Main.Test/App.xaml new file mode 100644 index 0000000..543a120 --- /dev/null +++ b/Main.Test/App.xaml @@ -0,0 +1,8 @@ + + + \ No newline at end of file diff --git a/Main.Test/App.xaml.cs b/Main.Test/App.xaml.cs new file mode 100644 index 0000000..91ae68a --- /dev/null +++ b/Main.Test/App.xaml.cs @@ -0,0 +1,57 @@ +using Main.Test.ViewModels; +using Main.Test.Views; +using MAX.Core.DependencyInjection; +using MAX.Core.Logger; +using Prism.Ioc; +using Prism.Modularity; +using Prism.Mvvm; +using System.Configuration; +using System.Data; +using System.Windows; +using Trade.Framework; +using Trade.Framework.Extensions; +using Trade.Framework.Services; + +namespace Main.Test; +/// +/// Interaction logic for App.xaml +/// +public partial class App : FrameworkApplication +{ + public IScopedProvider CurrentScope => throw new NotImplementedException(); + + protected override void OnStartup(StartupEventArgs e) + { + base.OnStartup(e); + + } + protected override Window CreateShell() + { + return Container.Resolve(); + } + + protected override void RegisterTypes(IContainerRegistry containerRegistry) + { + // 严格模式:FrameworkApplication 已关闭 DryIoc 按需动态注册(WithConcreteTypeDynamicRegistrations), + // 所有被解析的类型必须显式注册,否则抛 ContainerException。 + + // 启动 Shell + containerRegistry.Register(); + + // 窗口/控件 ViewModel(DISource 从容器解析) + containerRegistry.Register(); + containerRegistry.Register(); + + // 对话框:RegisterDialog 只注册 View 本身,VM 由 ViewModelLocator 从容器解析,需单独注册 + containerRegistry.RegisterDialog(nameof(bbbDialogView)); + containerRegistry.Register(); + + // 服务:原先靠 DryIoc 动态注册(Transient),显式注册保持同样行为 + //containerRegistry.Register(); + // 若希望 UserManager 全局只实例化一次: + // containerRegistry.RegisterSingleton(); + + //containerRegistry.RegisterSingleton(); + } + +} diff --git a/Main.Test/AssemblyInfo.cs b/Main.Test/AssemblyInfo.cs new file mode 100644 index 0000000..d9a1bde --- /dev/null +++ b/Main.Test/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/Main.Test/Main.Test.csproj b/Main.Test/Main.Test.csproj new file mode 100644 index 0000000..a6124fb --- /dev/null +++ b/Main.Test/Main.Test.csproj @@ -0,0 +1,24 @@ + + + + WinExe + $(DefaultTargetFramework)-windows + enable + enable + true + + + + + + + + + MSBuild:Compile + + + MSBuild:Compile + + + + diff --git a/Main.Test/MainWindow.xaml b/Main.Test/MainWindow.xaml new file mode 100644 index 0000000..54af584 --- /dev/null +++ b/Main.Test/MainWindow.xaml @@ -0,0 +1,19 @@ + + + + + diff --git a/Main.Test/MainWindow.xaml.cs b/Main.Test/MainWindow.xaml.cs new file mode 100644 index 0000000..7e781b9 --- /dev/null +++ b/Main.Test/MainWindow.xaml.cs @@ -0,0 +1,22 @@ +using System.Text; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace Main.Test; +/// +/// Interaction logic for MainWindow.xaml +/// +public partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/Main.Test/ViewModels/HeaderViewModel.cs b/Main.Test/ViewModels/HeaderViewModel.cs new file mode 100644 index 0000000..5e66fd0 --- /dev/null +++ b/Main.Test/ViewModels/HeaderViewModel.cs @@ -0,0 +1,30 @@ +using CommunityToolkit.Mvvm.Input; +using Main.Test.Views; +using Prism.Commands; +using Prism.Services.Dialogs; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Input; + +namespace Main.Test.ViewModels; + +internal class HeaderViewModel +{ + private readonly IDialogService _dialogService; + + public HeaderViewModel(IDialogService dialogService) + { + _dialogService = dialogService; + } + //public ICommand ccCommand => new AsyncDelegateCommand(cc); + + + [RelayCommand] + private async Task cc() + { + _dialogService.ShowDialog(nameof(bbbDialogView)); + } +} diff --git a/Main.Test/ViewModels/MainViewModel.cs b/Main.Test/ViewModels/MainViewModel.cs new file mode 100644 index 0000000..eacab68 --- /dev/null +++ b/Main.Test/ViewModels/MainViewModel.cs @@ -0,0 +1,20 @@ +using MAX.Core.Logger; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Trade.Framework.Services; + +namespace Main.Test.ViewModels; + +internal class MainViewModel +{ + private readonly ILoggerFacade _logger; + + public MainViewModel(ILoggerFacade logger, UserManager userManager) + { + _logger = logger; + _logger.Info("123123"); + } +} diff --git a/Main.Test/Views/HeaderView.xaml b/Main.Test/Views/HeaderView.xaml new file mode 100644 index 0000000..43d13e7 --- /dev/null +++ b/Main.Test/Views/HeaderView.xaml @@ -0,0 +1,16 @@ + + +