--- source_files: - DTS Viewer/DTS.Viewer.Loader/App.xaml.cs - DTS Viewer/DTS.Viewer.Loader/MainWindow.xaml.cs - DTS Viewer/DTS.Viewer.Loader/ViewerLoaderSession.cs - DTS Viewer/DTS.Viewer.Loader/Bootstrapper.cs generated_at: "2026-04-17T15:52:51.752685+00:00" model: "zai-org/GLM-5-FP8" schema_version: 1 sha256: "2bbbfac876b8311b" --- # DTS.Viewer.Loader Module Documentation ## 1. Purpose The `DTS.Viewer.Loader` module serves as the application entry point and bootstrapping layer for a Prism-based WPF viewer application. It is responsible for initializing the Unity dependency injection container, configuring module discovery via directory-based catalogs, creating the main shell window, and orchestrating the startup of the viewer session. This module acts as the composition root that wires together the various DTS framework components and dynamically loaded plugins. --- ## 2. Public Interface ### `App` (partial class, inherits `Application`) **File:** `App.xaml.cs` ```csharp private void App_OnStartup(object sender, StartupEventArgs e) ``` - Application startup event handler. - Instantiates a new `ViewerLoaderSession` and calls `CreateSession()` to initialize the application. --- ### `MainWindow` (partial class, inherits `Window`) **File:** `MainWindow.xaml.cs` ```csharp public MainWindow() ``` - Default constructor that calls `InitializeComponent()`. - **Note:** Based on the `Bootstrapper.CreateShell()` implementation, this window appears to be unused; the actual shell is `ShellView` resolved from the container. --- ### `ViewerLoaderSession` **File:** `ViewerLoaderSession.cs` ```csharp public ViewerLoaderSession() ``` - Default constructor. Performs no initialization. ```csharp public void CreateSession() ``` - Creates the bootstrapper, extracts core services from the Unity container (`IUnityContainer`, `IEventAggregator`, `IServiceLocator`, `IRegionManager`), resolves `IShellViewModel` and `IViewerModule`, starts the viewer session via `IViewerModule.StartSession()`, and sets the main region context. ```csharp public void Terminate() ``` - Intended for shutdown cleanup. Currently empty. Documented as being called only when "JMPS is in the process of shutting down." **Public Properties:** -