Files
DP44/enriched-qwen3-coder-next/Common/DTS.Common/Interface/DTS.Viewer.md

120 lines
9.8 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.Common/Interface/DTS.Viewer/ITabView.cs
- Common/DTS.Common/Interface/DTS.Viewer/IDiagView.cs
- Common/DTS.Common/Interface/DTS.Viewer/ITestsView.cs
- Common/DTS.Common/Interface/DTS.Viewer/IStatsView.cs
- Common/DTS.Common/Interface/DTS.Viewer/ICursorView.cs
- Common/DTS.Common/Interface/DTS.Viewer/IViewerView.cs
- Common/DTS.Common/Interface/DTS.Viewer/ITabItemView.cs
- Common/DTS.Common/Interface/DTS.Viewer/IPropertyView.cs
- Common/DTS.Common/Interface/DTS.Viewer/IViewerShellView.cs
- Common/DTS.Common/Interface/DTS.Viewer/IGraphPropertyView.cs
- Common/DTS.Common/Interface/DTS.Viewer/IDockPanelVerticalView.cs
- Common/DTS.Common/Interface/DTS.Viewer/IDockPanelHorizontalView.cs
- Common/DTS.Common/Interface/DTS.Viewer/GroupChannelReadCalcDelegate.cs
- Common/DTS.Common/Interface/DTS.Viewer/IExportModule.cs
- Common/DTS.Common/Interface/DTS.Viewer/IViewerModule.cs
- Common/DTS.Common/Interface/DTS.Viewer/IPSDReportModule .cs
- Common/DTS.Common/Interface/DTS.Viewer/ITabViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IDiagViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IStatsViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/ICursorViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/ITestsViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IViewerViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IPropertyViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IGraphPropertyViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IDockPanelVerticalViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IDockPanelHorizontalViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/ITabItemViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IViewerShellViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IMainLiteView.cs
- Common/DTS.Common/Interface/DTS.Viewer/IMainViewerView.cs
- Common/DTS.Common/Interface/DTS.Viewer/ISelectedDataViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IMainViewModel.cs
- Common/DTS.Common/Interface/DTS.Viewer/IMainLiteViewModel.cs
generated_at: "2026-04-16T03:00:55.719180+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "833fa0763e07cd73"
---
# Viewer Interface Module Documentation
## 1. Purpose
This module defines the core view and view model interfaces for the DTS Viewer applications UI layer. It establishes a contract-based architecture—following the MVVM pattern—where each interface represents a distinct UI component (e.g., tabs, panels, views, modules) and enforces a consistent relationship between view models and their corresponding views via strongly-typed `View` properties. The interfaces are intentionally minimal and declarative, serving as abstraction boundaries to decouple UI presentation logic from implementation details, enabling modular development and testability. The module is part of the `DTS.Common.Interface` namespace and relies on `DTS.Common.Base` for base contracts (`IBaseView`, `IBaseViewModel`) and `Prism.Modularity` for module lifecycle management.
## 2. Public Interface
### View Interfaces (all inherit `IBaseView`)
- **`ITabView`** Marker interface for tab container views.
- **`IDiagView`** Marker interface for diagnostic views.
- **`ITestsView`** Marker interface for tests views.
- **`IStatsView`** Marker interface for statistics views.
- **`ICursorView`** Marker interface for cursor control views.
- **`IViewerView`** Marker interface for main viewer content views.
- **`ITabItemView`** Marker interface for individual tab item views.
- **`IPropertyView`** Marker interface for property display/edit views.
- **`IGraphPropertyView`** Marker interface for graph-specific property views.
- **`IDockPanelVerticalView`** Marker interface for vertically docked panel views.
- **`IDockPanelHorizontalView`** Marker interface for horizontally docked panel views.
- **`IViewerShellView`** Marker interface for the main shell/container view.
- **`IMainLiteView`** Extends `IBaseView`; defines named UI regions (`MainShell`, `MainRegion`, `NavigationRegion`, `HorizontalTabRegion`, `VerticalTabRegion`) as `StackPanel`/`ContentControl` elements.
- **`IMainViewerView`** Extends `IBaseView`; currently has no additional members (commented-out region properties suggest future or legacy use).
### View Model Interfaces (all inherit `IBaseViewModel`)
- **`ITabViewModel`** Provides `ITabView View { get; }`.
- **`IDiagViewModel`** Provides `IDiagView View { get; }`.
- **`ITestsViewModel`** Provides `ITestsView View { get; }`.
- **`IStatsViewModel`** Provides `IStatsView View { get; }`.
- **`ICursorViewModel`** Provides `ICursorView View { get; }`.
- **`IViewerViewModel`** Provides `IViewerView View { get; }`.
- **`IPropertyViewModel`** Provides `IPropertyView View { get; }`.
- **`IGraphPropertyViewModel`** Provides `IGraphPropertyView View { get; }`.
- **`IDockPanelVerticalViewModel`** Provides `IDockPanelVerticalView View { get; }`.
- **`IDockPanelHorizontalViewModel`** Provides `IDockPanelHorizontalView View { get; }`.
- **`ITabItemViewModel`** Provides `ITabItemView View { get; }` and `ITabViewModel Parent { get; }`.
- **`IViewerShellViewModel`** Provides `IViewerShellView View { get; }`, `List<FrameworkElement> GetRegions()`, and `object ContextMainRegion { get; set; }`.
- **`IMainViewerViewModel`** Provides `IBaseView View { get; }`, `object Context*Region { get; set; }` for four named regions, and `List<FrameworkElement> GetRegions()`.
- **`IMainLiteViewModel`** Provides `IMainView View { get; }` (note: `IMainView` is *not defined in this file*), `object Context*Region { get; set; }` for four named regions, and `List<FrameworkElement> GetRegions()`.
- **`ISelectedDataViewModel`** Manages selected data context:
- `string SelectedDataFolder { get; set; }`
- `string SelectedDataFile { get; set; }`
- `void SelectAndIncludeDataFile(string file)` — Sets `SelectedDataFile` *and* includes it as a selected test (comment references bug #16158).
### Delegate
- **`SetReadCalcProgressValueDelegate`** Signature: `void(string message = "", double value = -1D)` — Used to report progress for read/calculation operations.
### Module Interfaces (all implement `Prism.Modularity.IModule`)
- **`IExportModule`** `void StartSession(); bool SessionStarted { get; }`
- **`IViewerModule`** `void StartSession(); bool SessionStarted { get; }`
- **`IPSDReportModule`** `void StartSession(); bool SessionStarted { get; }`
*(All modules share identical lifecycle contracts: start session, track session state.)*
## 3. Invariants
- **View-ViewModel Pairing**: Every view model interface (`*ViewModel`) declares a read-only `View` property whose type is the corresponding view interface (`*View`).
- **Hierarchical View Models**: `ITabItemViewModel` must have a `Parent` of type `ITabViewModel`.
- **Region Context Management**: `IMainViewerViewModel`, `IMainLiteViewModel`, and `IViewerShellViewModel` expose `Context*Region` properties for four named regions (`MainRegion`, `NavigationRegion`, `HorizontalTabRegion`, `VerticalTabRegion`), implying these regions are expected to be set/updated at runtime.
- **Module Lifecycle**: All module interfaces (`IExportModule`, `IViewerModule`, `IPSDReportModule`) require explicit `StartSession()` invocation and expose a `SessionStarted` state flag.
- **Base Contracts**: All interfaces inherit from `IBaseView` (for views) or `IBaseViewModel` (for view models), enforcing a common base contract (not detailed here).
## 4. Dependencies
- **Internal Dependencies**:
- `DTS.Common.Base` (provides `IBaseView`, `IBaseViewModel`)
- `Prism.Modularity` (for `IModule` interface, used in module interfaces)
- **External Dependencies**:
- `System.Windows` (used in `IMainLiteViewModel`, `IMainViewerViewModel`, `IViewerShellViewModel` for `FrameworkElement`, `StackPanel`, `ContentControl`)
- **Depended Upon**:
- This module is a *contract layer*—other modules (e.g., UI implementations, module plugins) depend on these interfaces to implement views, view models, and Prism modules.
- `ISelectedDataViewModel` is likely consumed by data browsing/selection components.
- `SetReadCalcProgressValueDelegate` is likely used by background computation modules.
## 5. Gotchas
- **Missing `IMainView`**: `IMainLiteViewModel` references `IMainView View { get; }`, but `IMainView` is *not defined in this file* (or any provided file). This is a critical dependency gap.
- **Redundant Module Interfaces**: `IExportModule`, `IViewerModule`, and `IPSDReportModule` have identical signatures—consider if a single shared interface would suffice or if future divergence is intended.
- **`IMainViewerView` is Empty**: Its region properties are commented out, suggesting incomplete or deprecated functionality.
- **`IViewerViewModel` Documentation Error**: Its `View` property summary says *“Gets the Tests View”* but the type is `IViewerView`, not `ITestsView`. Likely a copy-paste error in XML comments.
- **`ISelectedDataViewModel.SelectAndIncludeDataFile` Behavior**: The method sets `SelectedDataFile` *and* includes it as a selected test—this dual responsibility is non-obvious from the name alone.
- **No Validation Rules**: None of the interfaces enforce validation (e.g., `SelectedDataFile` must be non-null/non-empty), leaving this to implementations.
- **Delegate Default Values**: `SetReadCalcProgressValueDelegate` uses `message = ""` and `value = -1D` as defaults; callers should interpret `-1D` as “no progress update” or “indeterminate.”
- **No Inheritance Between View Interfaces**: Despite naming (e.g., `ITabView`, `ITabItemView`), there is no inheritance hierarchy among view interfaces—each is independent.