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

109 lines
8.2 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/Interface/Viewer/IMainView.cs
- Common/DTS.CommonCore/Interface/Viewer/IMenuView.cs
- Common/DTS.CommonCore/Interface/Viewer/IFilterView.cs
- Common/DTS.CommonCore/Interface/Viewer/INavigationView.cs
- Common/DTS.CommonCore/Interface/Viewer/ITestDefinitionListView.cs
- Common/DTS.CommonCore/Interface/Viewer/IMenuViewModel.cs
- Common/DTS.CommonCore/Interface/Viewer/INavigationViewModel.cs
- Common/DTS.CommonCore/Interface/Viewer/IFilterViewModel.cs
- Common/DTS.CommonCore/Interface/Viewer/ITestDefinitionListViewModel.cs
- Common/DTS.CommonCore/Interface/Viewer/IMainViewModel.cs
generated_at: "2026-04-16T02:22:43.523517+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "d625778ef337fcd6"
---
# Viewer Interface Module Documentation
## 1. Purpose
This module defines a set of interfaces that establish the contract for the *view* and *view model* layers in a modular UI architecture, specifically for a test definition and analysis application. It establishes a standardized structure for core UI regions—main view, menu, navigation, filter, and test summary list—by defining their corresponding view (`*View`) and view model (`*ViewModel`) interfaces, all inheriting from base interfaces in `DTS.Common.Base`. The module serves as a contract layer enabling decoupled UI composition, likely used in a region-based navigation framework (e.g., Prism), where views and view models are loosely coupled and injected into named regions of a shell application.
## 2. Public Interface
### View Interfaces (all inherit `IBaseView`):
- **`IMainView`**
Represents the main shell/window view. No additional members beyond `IBaseView`.
- **`IMenuView`**
Represents the menu view (e.g., top-level menu bar or context menu container). No additional members beyond `IBaseView`.
- **`IFilterView`**
Represents the filter/search view (e.g., search bar, filter controls). No additional members beyond `IBaseView`.
- **`INavigationView`**
Represents the navigation view (e.g., side navigation panel). No additional members beyond `IBaseView`.
- **`ITestSummaryListView`** *(note: interface name mismatch with file name)*
Represents the list view for test definitions/summaries. No additional members beyond `IBaseView`.
⚠️ *File declares `ITestDefinitionListView`, but interface is named `ITestSummaryListView`.*
### View Model Interfaces (all inherit `IBaseViewModel`):
- **`IMenuViewModel`**
- `IMenuView View { get; }` — Returns the associated menu view instance.
- **`INavigationViewModel`**
- `INavigationView NavigationView { get; }` — Returns the associated navigation view instance.
- **`IFilterViewModel`**
- `IBaseView View { get; }` — Returns the associated filter/search view instance.
- `IBaseViewModel Parent { get; }` — Reference to the parent view model (likely `IMainViewModel`).
- `object ContextSearchRegion { get; set; }` — Holds a reference to the UI region (e.g., content control) where search/filter results are displayed.
- **`ITestSummaryListViewModel`** *(note: interface name mismatch with file name)*
- `ITestSummaryListView TestSummaryListView { get; }` — Returns the associated test summary list view.
- `ObservableCollection<ITestSummary> TestSummaryList { get; set; }` — Collection of test summaries displayed in the list.
- `List<ITestSummary> SelectedTestSummaryList { get; set; }` — Currently selected test summaries.
- `void PublishSelectedTestSummaryList()` — Triggers publication of the selected list (e.g., for downstream processing or event broadcasting).
- **`IMainViewModel`**
- `IBaseView View { get; }` — Returns the main shell view instance.
- `object ContextNavigationRegion { get; set; }` — Reference to the navigation region container.
- `object ContextGraphRegion { get; set; }` — Reference to the primary graph region container.
- `object ContextTestsRegion { get; set; }` — Reference to the tests region container.
- `object ContextGraphsRegion { get; set; }` — Reference to the graphs region container (plural).
- `object ContextLegendRegion { get; set; }` — Reference to the legend region container.
- `object ContextDiagRegion { get; set; }` — Reference to the diagnostics region container.
- `object ContextStatsRegion { get; set; }` — Reference to the statistics region container.
- `object ContextCursorRegion { get; set; }` — Reference to the cursor/overlay region container.
- `object ContextPropertyRegion { get; set; }` — Reference to the property inspection region container.
- `List<FrameworkElement> GetRegions()` — Returns a list of all region containers as `FrameworkElement` instances.
## 3. Invariants
- All view interfaces (`*View`) must be implemented by UI controls (e.g., `UserControl`, `Window`) that inherit from `IBaseView`.
- All view model interfaces (`*ViewModel`) must be implemented by view models that inherit from `IBaseViewModel`.
- Each view model *must* expose a reference to its corresponding view via the `View`-typed property (e.g., `INavigationViewModel.NavigationView`, `IFilterViewModel.View`).
- `IFilterViewModel` requires a `Parent` reference, implying a hierarchical view model structure.
- `IMainViewModel` defines a fixed set of named region contexts (`Context*Region`)—these are expected to be non-null after initialization and must correspond to actual UI regions in the shell.
- `GetRegions()` must return a list containing *all* region containers, including those not explicitly named (e.g., `Context*Region` properties), to support generic region enumeration.
## 4. Dependencies
### Dependencies *on* this module:
- **`DTS.Common.Base`**: All interfaces inherit from `IBaseView` and `IBaseViewModel`, implying this module depends on the base layer for core contracts.
- **`DTS.Common.Interface.TestDefinition`**: `ITestSummaryListViewModel` references `ITestSummary`, indicating a dependency on the `TestDefinition` sub-namespace (likely defining test metadata models).
- **`System.Collections.Generic`, `System.Collections.ObjectModel`**: Used for list/collection properties in `ITestSummaryListViewModel`.
- **`System.Windows`**: `IMainViewModel.GetRegions()` returns `FrameworkElement`, indicating a WPF-specific dependency.
### Dependencies *of* this module:
- This module is *consumed* by higher-level UI composition layers (e.g., shell application, region managers, or DI containers) that instantiate and wire views/view models.
- Likely consumed by implementations in `DTS.App.*` or similar application projects.
## 5. Gotchas
- **Interface name mismatch**:
- File `ITestDefinitionListView.cs` declares interface `ITestSummaryListView` (not `ITestDefinitionListView`).
- File `ITestDefinitionListViewModel.cs` declares interface `ITestSummaryListViewModel` (not `ITestDefinitionListViewModel`).
This may cause confusion during code navigation or refactoring.
- **Ambiguous region semantics**:
`Context*Region` properties are typed as `object`, with no compile-time guarantee of their expected type (e.g., `ContentControl`, `Grid`). Consumers must assume runtime type compatibility.
- **Missing `INavigationView` vs. `NavigationView` naming**:
`INavigationViewModel.NavigationView` returns `INavigationView`, but the interface is named `INavigationView` (not `INavigationView`), which is consistent—but the *region* is named `ContextNavigationRegion`, not `ContextShellRegion`, suggesting potential naming inconsistency with other regions.
- **No explicit region registration**:
The interfaces define region *references* but no mechanism to register or validate region names—consumers must rely on external configuration (e.g., XAML region names matching property names like `ContextTestsRegion`).
- **`IFilterViewModel.ContextSearchRegion`**:
The name `ContextSearchRegion` suggests search-specific behavior, but the interface is named `IFilterView`—this may indicate legacy naming or incomplete refactoring.
- **No documentation for `GetRegions()` behavior**:
It is unclear whether `GetRegions()` includes *only* the explicitly named `Context*Region` properties or also other regions; implementation may vary.
None identified beyond the above.