init
This commit is contained in:
53
docs/ai/DTS Viewer/DTS.Viewer/Classes.md
Normal file
53
docs/ai/DTS Viewer/DTS.Viewer/Classes.md
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/Classes/MenuItem.cs
|
||||
- DTS Viewer/DTS.Viewer/Classes/TabItem.cs
|
||||
- DTS Viewer/DTS.Viewer/Classes/NavigationItem.cs
|
||||
- DTS Viewer/DTS.Viewer/Classes/BindingProxy.cs
|
||||
- DTS Viewer/DTS.Viewer/Classes/ComplonentsGroupControl.cs
|
||||
generated_at: "2026-04-17T16:11:25.310253+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "69a4590b22ea60d6"
|
||||
---
|
||||
|
||||
# Classes
|
||||
|
||||
### Purpose
|
||||
This module provides UI helper classes for the DTS Viewer WPF application. It includes a `BindingProxy` for enabling data binding in contexts where the data context is not directly accessible (e.g., within style setters), and a `ComponentsGroupControl` custom control for displaying grouped UI components with an image and title. Several placeholder classes (`MenuItem`, `TabItem`, `NavigationItem`) exist but contain no implementation.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**BindingProxy** (inherits `Freezable`)
|
||||
- `protected override Freezable CreateInstanceCore()` - Creates a new instance of `BindingProxy`. Required override for `Freezable` inheritance.
|
||||
- `public static readonly DependencyProperty DataProperty` - Dependency property identifier for `Data`.
|
||||
- `public object Data { get; set; }` - Gets or sets the data object to proxy for binding purposes.
|
||||
|
||||
**ComponentsGroupControl** (inherits `Control`)
|
||||
- `public class ClickEventArgs : EventArgs` - Nested event args class with default constructor.
|
||||
- `public static RoutedCommand ClickCommand { get; }` - Static routed command for click handling.
|
||||
- `public static readonly DependencyProperty ImageProperty` - Dependency property identifier for `Image`.
|
||||
- `public ImageSource Image { get; set; }` - Gets or sets the image source for the control.
|
||||
- `public static readonly DependencyProperty TitleProperty` - Dependency property identifier for `Title`.
|
||||
- `public string Title { get; set; }` - Gets or sets the title text; default value is "Title".
|
||||
|
||||
**MenuItem**
|
||||
- No public members defined (empty class).
|
||||
|
||||
**TabItem**
|
||||
- No public members defined (empty class).
|
||||
|
||||
**NavigationItem**
|
||||
- No public members defined (empty class).
|
||||
|
||||
### Invariants
|
||||
- `BindingProxy` must inherit from `Freezable` to participate in the WPF property system and support data binding in style setters.
|
||||
- `ComponentsGroupControl` registers a default style key via `DefaultStyleKeyProperty.OverrideMetadata` in its static constructor, implying a XAML style/template must exist elsewhere.
|
||||
- `ComponentsGroupControl.ClickCommand` is registered at the class level via `CommandManager.RegisterClassCommandBinding`.
|
||||
|
||||
### Dependencies
|
||||
- **Depends on**: `System.Windows`, `System.Windows.Controls`, `System.Windows.Input`, `System.Windows.Media`.
|
||||
- **Depended on by**: Unclear from source alone; likely used in DTS Viewer views and XAML templates.
|
||||
|
||||
### Gotchas
|
||||
- **Commented-out code**: `ComponentsGroupControl` contains commented
|
||||
72
docs/ai/DTS Viewer/DTS.Viewer/Modules/Main/View.md
Normal file
72
docs/ai/DTS Viewer/DTS.Viewer/Modules/Main/View.md
Normal file
@@ -0,0 +1,72 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/View/MainView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/View/ViewerShellView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/View/MainViewLite.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/View/ExportMainView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/View/ViewerMainView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/View/ExportMainViewGrid.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/View/ViewerMainViewGrid.xaml.cs
|
||||
generated_at: "2026-04-17T15:50:13.365274+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "5917449308f31e2b"
|
||||
---
|
||||
|
||||
# Documentation: DTS.Viewer Main View Components
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module contains the main view components for the DTS Viewer application, implementing a WPF-based visualization and export system. It provides multiple view variants (standard, lite, export, and viewer modes) that serve as UI shells for chart/graph visualization and PDF export functionality. The views follow a code-behind pattern with XAML partial classes, integrating with Prism's event aggregation system for loosely-coupled communication between components.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### MainView
|
||||
**Signature:** `public partial class MainView : IMainView`
|
||||
|
||||
**Constructor:**
|
||||
- `MainView()` — Initializes the component via `InitializeComponent()`.
|
||||
|
||||
**Behavior:** Minimal code-behind for the main window view. Serves as a shell container; actual behavior is defined in XAML and associated ViewModel.
|
||||
|
||||
---
|
||||
|
||||
### ViewerShellView
|
||||
**Signature:** `public partial class ViewerShellView : IViewerShellView`
|
||||
|
||||
**Constructor:**
|
||||
- `ViewerShellView()` — Initializes the component via `InitializeComponent()`.
|
||||
|
||||
**Behavior:** Shell view for the viewer mode. Minimal code-behind; behavior defined in XAML.
|
||||
|
||||
---
|
||||
|
||||
### MainViewLite
|
||||
**Signature:** `public partial class MainViewLite : IMainViewerView`
|
||||
|
||||
**Constructor:**
|
||||
- `MainViewLite()` — Initializes the component via `InitializeComponent()`.
|
||||
|
||||
**Behavior:** Lightweight variant of the main viewer view. Inherits from `UserControl`.
|
||||
|
||||
---
|
||||
|
||||
### ExportMainView
|
||||
**Signature:** `public partial class ExportMainView : IExportMainView`
|
||||
|
||||
**Constructor:**
|
||||
- `ExportMainView()` — Initializes the component via `InitializeComponent()`.
|
||||
|
||||
**Behavior:** View for export mode. Minimal code-behind.
|
||||
|
||||
---
|
||||
|
||||
### ViewerMainView
|
||||
**Signature:** `public partial class ViewerMainView : IViewerMainView`
|
||||
|
||||
**Constructor:**
|
||||
- `ViewerMainView()` — Initializes the component via `InitializeComponent()`.
|
||||
|
||||
**Behavior:** Main view for viewer mode. Contains commented-out code for AvalonDock layout serialization/deserialization (referencing `DockManager`, `XmlLayoutSerializer`,
|
||||
155
docs/ai/DTS Viewer/DTS.Viewer/Modules/Main/ViewModel.md
Normal file
155
docs/ai/DTS Viewer/DTS.Viewer/Modules/Main/ViewModel.md
Normal file
@@ -0,0 +1,155 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/ViewModel/ViewerShellViewModel.cs
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/ViewModel/MainViewModel.cs
|
||||
- DTS Viewer/DTS.Viewer/Modules/Main/ViewModel/ExportMainViewModel.cs
|
||||
generated_at: "2026-04-17T15:54:03.993512+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "1f3db03ef2ae0f10"
|
||||
---
|
||||
|
||||
# DTS Viewer Main Module ViewModels Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module contains the core ViewModel layer for the DTS Viewer application's main shell and content regions. It implements the MVVM pattern using Microsoft Prism and Unity IoC, providing three primary ViewModels: `ViewerShellViewModel` serves as the application shell container, `MainViewModel` manages the primary viewer interface with multiple regions (navigation, graph, property panels), and `ExportMainViewModel` extends functionality for data export operations including PDF generation and layout persistence. The module orchestrates view composition through region management and pub/sub event aggregation for loosely-coupled inter-component communication.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### ViewerShellViewModel
|
||||
|
||||
**Signature:** `public class ViewerShellViewModel : NotificationObject, IViewerShellViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `ViewerShellViewModel(IViewerShellView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` | Initializes the shell, sets up DataContext, creates interaction requests, subscribes to `RaiseNotification` event, and registers `IMainView`/`IMainViewModel` types with Unity. |
|
||||
| View | `public IViewerShellView View { get; private set; }` | Holds reference to the associated view. |
|
||||
| NotificationRequest | `public InteractionRequest<Notification> NotificationRequest { get; private set; }` | Prism interaction request for displaying notifications. |
|
||||
| ConfirmationRequest | `public InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }` | Prism interaction request for confirmation dialogs. |
|
||||
| Initialize | `public void Initialize()` | No-op implementation (assigns local variable `i = 10`). |
|
||||
| Initialize | `public void Initialize(object parameter)` | No-op implementation (assigns local variable `i = 22`). |
|
||||
| Initialize | `public void Initialize(object parameter, object model)` | Empty implementation. |
|
||||
| Activated | `public void Activated()` | No-op (assigns empty string to local variable). |
|
||||
| IsBusy | `bool IBaseViewModel.IsBusy { get; set; }` | Explicit interface implementation. |
|
||||
| GetRegions | `public List<FrameworkElement> GetRegions()` | Returns all elements named "Region" from `MainShell` using `Utils.GetChildrenByName`. |
|
||||
| ContextMainRegion | `public Object ContextMainRegion { get; set; }` | Gets/sets content of the `MainRegion` on the view. |
|
||||
| IsMenuIncluded | `public bool IsMenuIncluded { get; set; }` | Bound property with `OnPropertyChanged` notification. |
|
||||
| IsNavigationIncluded | `public bool IsNavigationIncluded { get; set; }` | Bound property with `OnPropertyChanged` notification. |
|
||||
| HeaderInfo | `public string HeaderInfo { get; }` | Returns constant string `"MainRegion"`. |
|
||||
| IsBusy | `public bool IsBusy { get; }` | **Throws `NotImplementedException`.** |
|
||||
| IsDirty | `public bool IsDirty { get; }` | **Throws `NotImplementedException`.** |
|
||||
| Cleanup | `public void Cleanup()` | **Throws `NotImplementedException`.** |
|
||||
| CleanupAsync | `public Task CleanupAsync()` | **Throws `NotImplementedException`.** |
|
||||
| InitializeAsync | `public Task InitializeAsync()` | **Throws `NotImplementedException`.** |
|
||||
| InitializeAsync | `public Task InitializeAsync(object parameter)` | **Throws `NotImplementedException`.** |
|
||||
|
||||
---
|
||||
|
||||
### MainViewModel
|
||||
|
||||
**Signature:** `public class MainViewModel : BaseViewModel<IMainViewModel>, IMainViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `MainViewModel(IMainView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` | Initializes view, DataContext, interaction requests, and subscribes to `RaiseNotification` event. |
|
||||
| View | `public IBaseView View { get; private set; }` | Reference to the associated view. |
|
||||
| NotificationRequest | `public InteractionRequest<Notification> NotificationRequest { get; private set; }` | Interaction request for notifications. |
|
||||
| ConfirmationRequest | `public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }` | Interaction request for confirmations (hides base member). |
|
||||
| Initialize | `public override void Initialize()` | Empty override. |
|
||||
| Initialize | `public override void Initialize(object parameter)` | Casts parameter to `IBaseWindowModel`, sets parent menu/navigation flags, subscribes to `AssemblyListNotification` and `BusyIndicatorChangeNotification` events. |
|
||||
| Activated | `public override void Activated()` | Empty override. |
|
||||
| ContextNavigationRegion | `public object ContextNavigationRegion { get; set; }` | Gets/sets `NavigationRegion.Content` from `MainView`. |
|
||||
| ContextGraphRegion | `public object ContextGraphRegion { get; set; }` | Gets/sets `GraphRegion.Content` from `MainView`. |
|
||||
| ContextTestsRegion | `public object ContextTestsRegion { get; set; }` | Gets/sets `TestsRegion.Content` from `MainView`. |
|
||||
| ContextGraphsRegion | `public object ContextGraphsRegion { get; set; }` | Gets/sets `GraphsRegion.Content` from `MainView`. |
|
||||
| ContextLegendRegion | `public object ContextLegendRegion { get; set; }` | Gets/sets `LegendRegion.Content` from `MainView`. |
|
||||
| ContextDiagRegion | `public object ContextDiagRegion { get; set; }` | Gets/sets `DiagRegion.Content` from `MainView`. |
|
||||
| ContextStatsRegion | `public object ContextStatsRegion { get; set; }` | Gets/sets `StatsRegion.Content` from `MainView`. |
|
||||
| ContextCursorRegion | `public object ContextCursorRegion { get; set; }` | Gets/sets `CursorRegion.Content` from `MainView`. |
|
||||
| ContextPropertyRegion | `public object ContextPropertyRegion { get; set; }` | Gets/sets `PropertyRegion.Content` from `MainView`. |
|
||||
| GetRegions | `public List<FrameworkElement> GetRegions()` | Returns all elements named "Region" from `MainShell`. |
|
||||
| IsBusy | `public new bool IsBusy { get; set; }` | Busy indicator state with notification. |
|
||||
| IsBusyMessage | `public new string IsBusyMessage { get; set; }` | Message for busy indicator. |
|
||||
| IsMenuIncluded | `public new bool IsMenuIncluded { get; set; }` | Menu inclusion flag. |
|
||||
| IsNavigationIncluded | `public new bool IsNavigationIncluded { get; set; }` | Navigation inclusion flag. |
|
||||
| HeaderInfo | `public string HeaderInfo { get; }` | Returns `"MainRegion"`. |
|
||||
|
||||
---
|
||||
|
||||
### ExportMainViewModel
|
||||
|
||||
**Signature:** `public class ExportMainViewModel : BaseViewModel<IExportMainViewModel>, IExportMainViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `ExportMainViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` | Initializes interaction requests, resolves `IExportMainViewGrid` as View, sets DataContext. |
|
||||
| View | `public IBaseView View { get; set; }` | Reference to the associated view. |
|
||||
| Standalone | `public bool Standalone { get; set; }` | Determines which view type to cast to (`ExportMainView` vs `ExportMainViewGrid`). |
|
||||
| SelectedTest | `public string SelectedTest { get; set; }` | Currently selected test identifier. |
|
||||
| SelectedDTSFile | `public string SelectedDTSFile { get; set; }` | Currently selected DTS file. |
|
||||
| SelectedEventList | `public List<ITestEvent> SelectedEventList { get; set; }` | List of selected test events. |
|
||||
| AvailableTestIds | `public List<string> AvailableTestIds { get; set; }` | Available test IDs. |
|
||||
| AddSelectedEvents | `public void AddSelectedEvents(string groupName, List<ITestEvent> events)` | Publishes busy indicator, adds events to `SelectedEventList`, then clears busy indicator. |
|
||||
| SelectAndIncludeDataFile | `public void SelectAndIncludeDataFile(string value)` | Sets `_selectedDataFile` and publishes `DataFolderChangedEvent`. |
|
||||
| Initialize | `public override void Initialize()` | Calls `Subscribe()` to register event handlers. |
|
||||
| Initialize | `public override void Initialize(object parameter)` | Sets parent, menu/navigation flags, calls `Subscribe()`, sets DataContext. |
|
||||
| Activated | `public override void Activated()` | Empty override. |
|
||||
| ZoomReset | `public void ZoomReset()` | Publishes `ResetZoomChangedEvent` with `true`. |
|
||||
| LeftKeyPress | `public void LeftKeyPress()` | Publishes `ShiftT0Event` with step `-1`. |
|
||||
| RightKeyPress | `public void RightKeyPress()` | Publishes `ShiftT0Event` with step `1`. |
|
||||
| LoadLayoutCommand | `public ICommand LoadLayoutCommand { get; }` | Loads AvalonDock layout from `.\DataProViewerAvalonDock.config`. |
|
||||
| SaveLayoutCommand | `public ICommand SaveLayoutCommand { get; }` | Saves AvalonDock layout to `.\AvalonDock.config`. |
|
||||
| ContextNavigationRegion | `public object ContextNavigationRegion { get; set; }` | Region content accessor; behavior varies by `Standalone` flag. |
|
||||
| ContextGraphRegion | `public object ContextGraphRegion { get; set; }` | Region content accessor; behavior varies by `Standalone` flag. |
|
||||
| ContextGraphListRegion | `public object ContextGraphListRegion { get; set; }` | Region content accessor; behavior varies by `Standalone` flag. |
|
||||
| ContextTestsRegion | `public object ContextTestsRegion { get; set; }` | Region content accessor; behavior varies by `Standalone` flag. |
|
||||
| ContextGraphsRegion | `public object ContextGraphsRegion { get; set; }` | Maps to `GraphListRegion` content. |
|
||||
| ContextPropertyRegion | `public object ContextPropertyRegion { get; set; }` | Property region content. |
|
||||
| SettingsVisibility | `public Visibility SettingsVisibility { get; private set; }` | Controls settings panel visibility. |
|
||||
| TotalSelectedTests | `public int TotalSelectedTests { get; set; }` | Count with title update side effect. |
|
||||
| TotalLoadedTests | `public int TotalLoadedTests { get; set; }` | Count with title update side effect. |
|
||||
| TotalSelectedGraphs | `public int TotalSelectedGraphs { get; set; }` | Count with title update side effect. |
|
||||
| TotalLoadedGraphs | `public int TotalLoadedGraphs { get; set; }` | Count with title update side effect. |
|
||||
| SelectedDataFolder | `public string SelectedDataFolder { get; set; }` | Publishes `DataFolderChangedEvent` on set. |
|
||||
| SelectedDataFile | `public string SelectedDataFile { get; set; }` | Publishes `DataFolderChangedEvent` on set. |
|
||||
| ShowModifications | `public bool ShowModifications { get; set; }` | Set to `true` when T0 shift occurs. |
|
||||
| ChannelCodeViewMode | `public IsoViewMode ChannelCodeViewMode { get; set; }` | Publishes `ChannelCodesViewChangedEvent` on set. |
|
||||
| CalibrationBehaviorSetting | `public CalibrationBehaviors CalibrationBehaviorSetting { get; set; }` | Publishes `ExportCalibrationBehaviorSettingChangedEvent` on set. |
|
||||
| CalibrationBehaviorSettableInViewer | `public bool CalibrationBehaviorSettableInViewer { get; set; }` | Publishes event and selects graphs tab on set. |
|
||||
| IsBusy | `public new bool IsBusy { get; set; }` | Busy indicator state. |
|
||||
| IsBusyMessage | `public new string IsBusyMessage { get; set; }` | Busy indicator message. |
|
||||
| HeaderInfo | `public string HeaderInfo { get; }` | Returns `"MainRegion"`. |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
1. **MEF Singleton Shell**: `ViewerShellViewModel` is exported with `CreationPolicy.Shared`, ensuring a single shell instance per application.
|
||||
|
||||
2. **Region Naming Convention**: All regions are accessed via properties named `Context*Region` and are retrieved from view controls with corresponding `*Region` property names.
|
||||
|
||||
3. **Event Subscription Pattern**: All ViewModels subscribe to events in their constructors or `Initialize` methods; no unsubscription logic is visible in the source.
|
||||
|
||||
4. **Parent-Child Relationship**: `MainViewModel` and `ExportMainViewModel` expect `Initialize(object parameter)` to receive an `IBaseWindowModel` castable object.
|
||||
|
||||
5. **Standalone Mode Switching**: `ExportMainViewModel` region accessors must check `Standalone` boolean to determine correct view type (`ExportMainView` vs `ExportMainViewGrid`).
|
||||
|
||||
6. **Busy Indicator Pairing**: `IsBusy` and `IsBusyMessage` are intended to be used together for UI feedback during operations.
|
||||
|
||||
7. **Layout File Dependencies**: `LoadLayoutCommand` requires `.\DataProViewerAvalonDock.config` to exist; `SaveLayoutCommand` writes to `.\AvalonDock.config`.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### External Dependencies (from imports)
|
||||
- `Microsoft.Practices.Prism.Events` - Event aggregation (`IEventAggregator`, `ThreadOption`)
|
||||
- `Microsoft.Practices.Prism.Interactivity.InteractionRequest` - `InteractionRequest<T>`, `Notification`, `Confirmation`
|
||||
- `Microsoft.Practices.Prism.Regions` - `IRegionManager`
|
||||
- `Microsoft.Practices.Prism.ViewModel` - `NotificationObject`
|
||||
- `Microsoft.Practices.Unity` - `IUnityContainer`, `ContainerControlledLifetimeManager`
|
||||
- `System.ComponentModel.Composition` - MEF attributes (`Export`, `PartCreationPolicy`, `CreationPolicy`)
|
||||
- `Xceed.Wpf.A
|
||||
43
docs/ai/DTS Viewer/DTS.Viewer/Properties.md
Normal file
43
docs/ai/DTS Viewer/DTS.Viewer/Properties.md
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/Properties/Settings.Designer.cs
|
||||
- DTS Viewer/DTS.Viewer/Properties/AssemblyInfo.cs
|
||||
- DTS Viewer/DTS.Viewer/Properties/Resources.Designer.cs
|
||||
generated_at: "2026-04-17T16:11:52.542617+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "756efe4e3038db08"
|
||||
---
|
||||
|
||||
# Properties
|
||||
|
||||
### 1. Purpose
|
||||
This module contains the assembly-level configuration and auto-generated code for the `DTS.Viewer` assembly. It defines the application's identity, version information, and provides strongly-typed access to application settings and localized resources via the `Properties` namespace. It serves as the configuration backbone for the DTS Viewer application.
|
||||
|
||||
### 2. Public Interface
|
||||
**Class: `Settings`** (in `Settings.Designer.cs`)
|
||||
* `public static Settings Default { get; }`: Provides access to the singleton instance of the application settings wrapper.
|
||||
|
||||
**Class: `Resources`** (in `Resources.Designer.cs`)
|
||||
* `internal static global::System.Resources.ResourceManager ResourceManager { get; }`: Returns the cached resource manager instance used for looking up localized strings.
|
||||
* `internal static global::System.Globalization.CultureInfo Culture { get; set; }`: Gets or sets the current UI culture for resource lookups.
|
||||
|
||||
**Assembly Attributes** (in `AssemblyInfo.cs`)
|
||||
* `AssemblyTitle`: "DTS.Viewer"
|
||||
* `AssemblyCompany`: "Diversified Technical Systems, Inc. (DTS)"
|
||||
* `AssemblyVersion`: "1.0.0.0"
|
||||
* `AssemblyFileVersion`: "1.0.0.0"
|
||||
|
||||
### 3. Invariants
|
||||
* The `Settings` class is a sealed, singleton wrapper inheriting from `ApplicationSettingsBase`.
|
||||
* The `Resources` class is auto-generated and intended for internal access only (`internal` class).
|
||||
* Files `Settings.Designer.cs` and `Resources.Designer.cs` are marked with `GeneratedCodeAttribute`; manual changes will be overwritten by tooling.
|
||||
|
||||
### 4. Dependencies
|
||||
* **Depends on**: `System.Configuration` (for `ApplicationSettingsBase`), `System.Resources` (for `ResourceManager`), `System.Runtime.CompilerServices`, `System.CodeDom.Compiler`.
|
||||
* **Depended on by**: The main `DTS.Viewer` application logic (for accessing settings and resources).
|
||||
|
||||
### 5. Gotchas
|
||||
* None identified from source alone, other than the standard warning that designer files should not be manually edited.
|
||||
|
||||
---
|
||||
21
docs/ai/DTS Viewer/DTS.Viewer/RegionAdapters.md
Normal file
21
docs/ai/DTS Viewer/DTS.Viewer/RegionAdapters.md
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/RegionAdapters/StackPanelRegionAdapter.cs
|
||||
generated_at: "2026-04-17T16:13:40.918650+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "02157f0db2bb8b54"
|
||||
---
|
||||
|
||||
# RegionAdapters
|
||||
|
||||
### Purpose
|
||||
This module provides a custom Prism Region Adapter for `StackPanel` controls, enabling the Prism region management system to dynamically add and remove UI elements within a `StackPanel`. It bridges the gap between Prism's region architecture and WPF's `StackPanel` container, allowing views to be composed dynamically at runtime.
|
||||
|
||||
### Public Interface
|
||||
|
||||
- **`StackPanelRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)`** (Constructor)
|
||||
- Initializes the adapter with the specified `IRegionBehaviorFactory`. Required by the base `RegionAdapterBase<StackPanel>`.
|
||||
|
||||
- **`protected override void Adapt(IRegion region, StackPanel regionTarget)`**
|
||||
- Subscribes to the `region.Views.CollectionChanged` event and synchronizes the `StackPanel.Children` collection with the region's views. Handles `NotifyCollection
|
||||
39
docs/ai/DTS Viewer/DTS.Viewer/Resources.md
Normal file
39
docs/ai/DTS Viewer/DTS.Viewer/Resources.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/Resources/TranslateExtension.cs
|
||||
- DTS Viewer/DTS.Viewer/Resources/StringResources.Designer.cs
|
||||
generated_at: "2026-04-17T16:12:03.600226+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "4d3d5da77d9b6b31"
|
||||
---
|
||||
|
||||
# Resources
|
||||
|
||||
### Purpose
|
||||
This module provides localization infrastructure for the DTS Viewer application. It contains a WPF markup extension for XAML binding to localized strings and an auto-generated strongly-typed resource class that wraps access to the underlying `.resx` resource file.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**`TranslateExtension` (class)**
|
||||
- Inherits: `MarkupExtension`
|
||||
- Attribute: `[MarkupExtensionReturnType(typeof(string))]`
|
||||
- Constructor: `TranslateExtension(string key)` — Stores the resource key for lookup.
|
||||
- `object ProvideValue(IServiceProvider serviceProvider)` — Returns the localized string for the stored `_key`. Returns `#stringnotfound#` if the key is null/empty, or `#stringnotfound# {key}` if the lookup fails.
|
||||
|
||||
**`StringResources` (class)**
|
||||
- Attribute: `internal`
|
||||
- `static ResourceManager ResourceManager` — Gets the cached `ResourceManager` instance for this assembly.
|
||||
- `static CultureInfo Culture` — Gets or sets the current UI culture for resource lookups.
|
||||
- **Resource String Properties (static getters):**
|
||||
- `string ChartOptionsHeader` — Localized string "Chart Options".
|
||||
- `string GraphsDefaultTitle` — Localized string "Graphs ".
|
||||
- `string ModificationsHeader` — Localized string "Modify".
|
||||
- `string SavePDFError` — Localized string "Error occurred saving chart to PDF".
|
||||
- `string SavePDFSuccess` — Localized string "Chart saved succesfully as {0}{1} and {2}{3}".
|
||||
- `string SettingsTitle` — Localized string "Settings".
|
||||
- `string TestIDsDefaultTitle` — Localized string "Test IDs".
|
||||
- `string TestsDefaultTitle` — Localized string "Tests ".
|
||||
|
||||
### Invariants
|
||||
-
|
||||
53
docs/ai/DTS Viewer/DTS.Viewer/View.md
Normal file
53
docs/ai/DTS Viewer/DTS.Viewer/View.md
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/TabView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/View/MenuView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/View/MainView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/View/ShellView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/View/ViewerShellView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer/View/NavigationView.xaml.cs
|
||||
generated_at: "2026-04-17T16:28:39.450430+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "36dc40ad355c1541"
|
||||
---
|
||||
|
||||
# View
|
||||
|
||||
### Purpose
|
||||
This module provides WPF view components for the DTS Viewer application. It contains code-behind files for various XAML views that implement interfaces from `DTS.Common.Interface`, following a view-first architecture where each view is a partial class paired with XAML markup. The views serve as passive containers with no logic beyond initialization.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**TabView** : `ITabView`
|
||||
- `TabView()` - Default constructor that calls `InitializeComponent()` to load the associated XAML.
|
||||
|
||||
**MenuView** : `IMenuView`
|
||||
- `MenuView()` - Default constructor that calls `InitializeComponent()` to load the associated XAML.
|
||||
|
||||
**MainView** : `IMainView`
|
||||
- `MainView()` - Default constructor that calls `InitializeComponent()` to load the associated XAML.
|
||||
|
||||
**ShellView** : `IViewerShellView`
|
||||
- `ShellView()` - Default constructor that calls `InitializeComponent()` to load the associated XAML.
|
||||
|
||||
**ViewerShellView** : `IViewerShellView`
|
||||
- `ViewerShellView()` - Default constructor that calls `InitializeComponent()` to load the associated XAML.
|
||||
|
||||
**NavigationView** : `INavigationView`
|
||||
- `NavigationView()` - Default constructor that calls `InitializeComponent()` to load the associated XAML.
|
||||
|
||||
### Invariants
|
||||
- Each view must have a corresponding XAML file (e.g., `TabView.xaml`) that defines the UI layout.
|
||||
- All views implement their respective interfaces from `DTS.Common.Interface`.
|
||||
- `ShellView` and `ViewerShellView` both implement `IViewerShellView` - unclear if they are intended to be interchangeable or serve different contexts.
|
||||
|
||||
### Dependencies
|
||||
- **Depends on**: `DTS.Common.Interface` (for `ITabView`, `IMenuView`, `IMainView`, `IViewerShellView`, `INavigationView` interfaces)
|
||||
- **Depended on by**: Not determinable from source alone; likely consumed by a bootstrapper or DI container configuration.
|
||||
|
||||
### Gotchas
|
||||
- **Duplicate shell view implementations**: Both `ShellView` and `ViewerShellView` implement `IViewerShellView`. The source does not clarify which is canonical or under what circumstances each is used. They exist in different namespaces (`DTS.Viewer.View` vs `DTS.Viewer`).
|
||||
- No view logic beyond initialization is present; any behavior must be implemented in associated ViewModels or elsewhere.
|
||||
|
||||
---
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelHorizontal/View/DockPanelHorizontalView.xaml.cs
|
||||
generated_at: "2026-04-17T16:13:40.920030+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "d3dadc17e8cfb160"
|
||||
---
|
||||
|
||||
# View
|
||||
|
||||
### Purpose
|
||||
This module provides the code-behind for the `AddCalculatedChannelView` XAML view, serving as the UI component for adding calculated channels within the DTS Viewer application. It implements the `IAddCalculatedChannelView` interface to integrate with the application's view abstraction layer, enabling loose coupling between the view and its consuming components.
|
||||
|
||||
### Public Interface
|
||||
|
||||
- **`AddCalculatedChannelView()`** (Constructor)
|
||||
- Initializes the component by calling `InitializeComponent()`. No additional parameters or logic.
|
||||
|
||||
- **`IAddCalculatedChannelView`** (Implemented Interface)
|
||||
- The class implements this interface from `DTS.Common.Interface`, making it usable wherever the interface type is required.
|
||||
|
||||
### Invariants
|
||||
- The view must be a partial class to support WPF's code-generation model for XAML.
|
||||
- `InitializeComponent()` must be called exactly once during construction to load the associated XAML.
|
||||
|
||||
### Dependencies
|
||||
- **Depends on:** `DTS.Common.Interface` (for `IAddCalculatedChannelView` interface)
|
||||
- **Depended on by:** Cannot be determined from source alone (likely consumed by a presenter/viewmodel or region navigation in the broader application)
|
||||
|
||||
### Gotchas
|
||||
- The file includes a ReSharper directive `// ReSharper disable CheckNamespace`, suggesting the namespace `DTS.Viewer.AddCalculatedChannel` may not match the project's default namespace structure. This could cause confusion during refactoring or when locating the view.
|
||||
|
||||
---
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelHorizontal/ViewModel/DockPanelHorizontalViewModel.cs
|
||||
generated_at: "2026-04-17T16:29:26.445526+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "ce03b3583ccf9c32"
|
||||
---
|
||||
|
||||
# ViewModel
|
||||
|
||||
### Purpose
|
||||
This module provides the `DockPanelHorizontalViewModel` class, a Prism-based ViewModel for a horizontal dock panel UI component in the DTS Viewer application. It serves as a mediator between the view (`IDockPanelHorizontalView`) and the application infrastructure, handling notification requests via Prism's `InteractionRequest` pattern and subscribing to application-wide `RaiseNotification` events.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**Class:** `DockPanelHorizontalViewModel` (extends `BaseViewModel<IDockPanelHorizontalViewModel>`, implements `IDockPanelHorizontalViewModel`)
|
||||
|
||||
**Constructor:**
|
||||
```csharp
|
||||
public DockPanelHorizontalViewModel(
|
||||
IDockPanelHorizontalView view,
|
||||
IRegionManager regionManager,
|
||||
IEventAggregator eventAggregator,
|
||||
IUnityContainer unityContainer)
|
||||
```
|
||||
Initializes the ViewModel, sets the View's DataContext to itself, creates `NotificationRequest` and `ConfirmationRequest` instances, and subscribes to the `RaiseNotification` event.
|
||||
|
||||
**Properties:**
|
||||
- `IDockPanelHorizontalView View { get; }` — The associated view instance.
|
||||
- `InteractionRequest<Notification> NotificationRequest { get; }` — Used to raise notification dialogs.
|
||||
- `InteractionRequest<Confirmation> ConfirmationRequest { get; }` — Used to raise confirmation dialogs.
|
||||
- `bool IsMenuIncluded { get; set; }` — UI state flag.
|
||||
- `bool IsNavigationIncluded { get; set; }` — UI state flag.
|
||||
- `bool IsBusy { get; set; }` — Indicates busy state.
|
||||
- `bool IsDirty { get; private set; }` — Indicates unsaved changes.
|
||||
|
||||
**Events:**
|
||||
- `event PropertyChangedEventHandler PropertyChanged` — Declared but not explicitly invoked in visible code.
|
||||
|
||||
**Methods:**
|
||||
- `void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)` — Private handler that raises `NotificationRequest` with title, message, details, and image from the event args.
|
||||
- `override void Initialize()` — Throws `NotImplementedException`.
|
||||
- `override void Initialize(object parameter)` — Throws `NotImplementedException`.
|
||||
- `void Initialize(object parameter, object model)` — Throws `NotImplementedException` (hides base with `new`).
|
||||
- `override void Activated()` — Throws `NotImplementedException`.
|
||||
- `override void Cleanup()` — Throws `NotImplementedException`.
|
||||
- `Task CleanupAsync()` — Throws `NotImplementedException` (hides base with `new`).
|
||||
- `override Task InitializeAsync()` — Throws `NotImplementedException`.
|
||||
- `override Task InitializeAsync(object parameter)` — Throws `NotImplementedException`.
|
||||
|
||||
### Invariants
|
||||
- The View's `DataContext` is always set to the ViewModel instance upon construction.
|
||||
- The ViewModel subscribes to `RaiseNotification` event via `EventAggregator` on construction.
|
||||
- `IsDirty` is read-only externally (private setter).
|
||||
|
||||
### Dependencies
|
||||
**Depends on:**
|
||||
- `DTS.Common.Base` (`BaseViewModel<T>`)
|
||||
- `DTS.Common.Events` (`RaiseNotification`, `NotificationContentEventArgs`, `NotificationContentEventArgsWithoutTitle` — inferred from usage)
|
||||
- `DTS.Common.Interface` (`IViewModel`, `IDockPanelHorizontalViewModel`, `IDockPanelHorizontalView`)
|
||||
- `Microsoft.Practices.Prism.Events` (`IEventAggregator
|
||||
27
docs/ai/DTS Viewer/DTS.Viewer/View/DockPanelVertical/View.md
Normal file
27
docs/ai/DTS Viewer/DTS.Viewer/View/DockPanelVertical/View.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelVertical/View/DockPanelVerticalView.xaml.cs
|
||||
generated_at: "2026-04-17T16:13:30.756881+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "5f012e08f6e61377"
|
||||
---
|
||||
|
||||
# View
|
||||
|
||||
### Purpose
|
||||
The `NavigationViewModel` class serves as the ViewModel component for the navigation region in a Prism-based WPF application. It manages the `ContextNavigationRegion` content area, handles notification display via event aggregation, and coordinates with a parent `IShellViewModel`. This module exists to decouple navigation logic from the view while providing notification capabilities through the Prism InteractionRequest pattern.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**Constructor**
|
||||
- `NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` — Initializes the view model, sets the view's DataContext, creates `NotificationRequest` and `ConfirmationRequest` interaction requests, and subscribes to the `RaiseNotification` event.
|
||||
|
||||
**Properties**
|
||||
- `INavigationView NavigationView { get; }` — Returns the associated navigation view instance.
|
||||
- `InteractionRequest<Notification> NotificationRequest { get; }` — Interaction request for displaying notifications.
|
||||
- `InteractionRequest<Confirmation> ConfirmationRequest { get; }` — Interaction request for displaying confirmations.
|
||||
- `object ContextNavigationRegion { get; set; }` — Gets or sets the content of the `NavigationRegion` from the underlying `NavigationView`. Raises `OnPropertyChanged` on set.
|
||||
- `string HeaderInfo { get; }` — Always returns `"NavigationRegion"`.
|
||||
- `bool IsBusy { get; set; }` — Throws `NotImplementedException` on both getter and setter.
|
||||
- `bool IsDirty { get;
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelVertical/ViewModel/DockPanelVerticalViewModel.cs
|
||||
generated_at: "2026-04-17T16:13:30.756128+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "af40e1e596555938"
|
||||
---
|
||||
|
||||
# ViewModel
|
||||
|
||||
### Purpose
|
||||
The `NavigationViewModel` class serves as the ViewModel component for the navigation region in a Prism-based WPF application. It manages the `ContextNavigationRegion` content area, handles notification display via event aggregation, and coordinates with a parent `IShellViewModel`. This module exists to decouple navigation logic from the view while providing notification capabilities through the Prism InteractionRequest pattern.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**Constructor**
|
||||
- `NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` — Initializes the view model, sets the view's DataContext, creates `NotificationRequest` and `ConfirmationRequest` interaction requests, and subscribes to the `RaiseNotification` event.
|
||||
|
||||
**Properties**
|
||||
- `INavigationView NavigationView { get; }` — Returns the associated navigation view instance.
|
||||
- `InteractionRequest<Notification> NotificationRequest { get; }` — Interaction request for displaying notifications.
|
||||
- `InteractionRequest<Confirmation> ConfirmationRequest { get; }` — Interaction request for displaying confirmations.
|
||||
- `object ContextNavigationRegion { get; set; }` — Gets or sets the content of the `NavigationRegion` from the underlying `NavigationView`. Raises `OnPropertyChanged` on set.
|
||||
- `string HeaderInfo { get; }` — Always returns `"NavigationRegion"`.
|
||||
- `bool IsBusy { get; set; }` — Throws `NotImplementedException` on both getter and setter.
|
||||
- `bool IsDirty { get;
|
||||
27
docs/ai/DTS Viewer/DTS.Viewer/View/Navigation/View.md
Normal file
27
docs/ai/DTS Viewer/DTS.Viewer/View/Navigation/View.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/Navigation/View/NavigationView.xaml.cs
|
||||
generated_at: "2026-04-17T16:13:30.755321+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "d3b62006cfac1bfc"
|
||||
---
|
||||
|
||||
# View
|
||||
|
||||
### Purpose
|
||||
The `NavigationViewModel` class serves as the ViewModel component for the navigation region in a Prism-based WPF application. It manages the `ContextNavigationRegion` content area, handles notification display via event aggregation, and coordinates with a parent `IShellViewModel`. This module exists to decouple navigation logic from the view while providing notification capabilities through the Prism InteractionRequest pattern.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**Constructor**
|
||||
- `NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` — Initializes the view model, sets the view's DataContext, creates `NotificationRequest` and `ConfirmationRequest` interaction requests, and subscribes to the `RaiseNotification` event.
|
||||
|
||||
**Properties**
|
||||
- `INavigationView NavigationView { get; }` — Returns the associated navigation view instance.
|
||||
- `InteractionRequest<Notification> NotificationRequest { get; }` — Interaction request for displaying notifications.
|
||||
- `InteractionRequest<Confirmation> ConfirmationRequest { get; }` — Interaction request for displaying confirmations.
|
||||
- `object ContextNavigationRegion { get; set; }` — Gets or sets the content of the `NavigationRegion` from the underlying `NavigationView`. Raises `OnPropertyChanged` on set.
|
||||
- `string HeaderInfo { get; }` — Always returns `"NavigationRegion"`.
|
||||
- `bool IsBusy { get; set; }` — Throws `NotImplementedException` on both getter and setter.
|
||||
- `bool IsDirty { get;
|
||||
27
docs/ai/DTS Viewer/DTS.Viewer/View/Navigation/ViewModel.md
Normal file
27
docs/ai/DTS Viewer/DTS.Viewer/View/Navigation/ViewModel.md
Normal file
@@ -0,0 +1,27 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/Navigation/ViewModel/NavigationViewModel.cs
|
||||
generated_at: "2026-04-17T16:13:30.752772+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "9a2cd7ffc388b646"
|
||||
---
|
||||
|
||||
# ViewModel
|
||||
|
||||
### Purpose
|
||||
The `NavigationViewModel` class serves as the ViewModel component for the navigation region in a Prism-based WPF application. It manages the `ContextNavigationRegion` content area, handles notification display via event aggregation, and coordinates with a parent `IShellViewModel`. This module exists to decouple navigation logic from the view while providing notification capabilities through the Prism InteractionRequest pattern.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**Constructor**
|
||||
- `NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` — Initializes the view model, sets the view's DataContext, creates `NotificationRequest` and `ConfirmationRequest` interaction requests, and subscribes to the `RaiseNotification` event.
|
||||
|
||||
**Properties**
|
||||
- `INavigationView NavigationView { get; }` — Returns the associated navigation view instance.
|
||||
- `InteractionRequest<Notification> NotificationRequest { get; }` — Interaction request for displaying notifications.
|
||||
- `InteractionRequest<Confirmation> ConfirmationRequest { get; }` — Interaction request for displaying confirmations.
|
||||
- `object ContextNavigationRegion { get; set; }` — Gets or sets the content of the `NavigationRegion` from the underlying `NavigationView`. Raises `OnPropertyChanged` on set.
|
||||
- `string HeaderInfo { get; }` — Always returns `"NavigationRegion"`.
|
||||
- `bool IsBusy { get; set; }` — Throws `NotImplementedException` on both getter and setter.
|
||||
- `bool IsDirty { get;
|
||||
134
docs/ai/DTS Viewer/DTS.Viewer/ViewModel.md
Normal file
134
docs/ai/DTS Viewer/DTS.Viewer/ViewModel.md
Normal file
@@ -0,0 +1,134 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/ViewModel/NavigationViewModel.cs
|
||||
- DTS Viewer/DTS.Viewer/ViewModel/MenuViewModel.cs
|
||||
- DTS Viewer/DTS.Viewer/ViewModel/ShellViewModel.cs
|
||||
- DTS Viewer/DTS.Viewer/ViewModel/ViewerShellViewModel.cs
|
||||
- DTS Viewer/DTS.Viewer/ViewModel/MainViewModel.cs
|
||||
generated_at: "2026-04-17T15:52:42.813402+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "d5b4057c745da02a"
|
||||
---
|
||||
|
||||
# DTS.Viewer ViewModel Module Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
This module provides the core ViewModel layer for the DTS Viewer WPF application, implementing the MVVM pattern with Prism framework integration. It contains the shell-level view models (`ShellViewModel`, `ViewerShellViewModel`), navigation components (`NavigationViewModel`), menu handling (`MenuViewModel`), and main content orchestration (`MainViewModel`). These ViewModels manage view lifecycle, region navigation, event aggregation for decoupled communication, and dependency injection registration for their associated views.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### NavigationViewModel
|
||||
**Signature:** `public class NavigationViewModel : BaseViewModel<INavigationViewModel>, INavigationViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` | Initializes the view model, sets DataContext on view, creates interaction requests, and subscribes to `RaiseNotification` event. |
|
||||
| NavigationView | `public INavigationView NavigationView { get; private set; }` | Holds reference to the associated navigation view. |
|
||||
| ContextNavigationRegion | `public object ContextNavigationRegion { get; set; }` | Gets/sets content of the `NavigationRegion` from the `NavigationView`. Raises `OnPropertyChanged` on set. |
|
||||
| HeaderInfo | `public string HeaderInfo { get; }` | Returns constant string `"NavigationRegion"`. |
|
||||
| Initialize | `public override void Initialize()` | Empty implementation. |
|
||||
| Initialize | `public override void Initialize(object parameter)` | Casts parameter to `IShellViewModel` and assigns to `Parent` field. |
|
||||
| NotificationRequest | `public InteractionRequest<Notification> NotificationRequest { get; private set; }` | Prism interaction request for notifications. |
|
||||
| ConfirmationRequest | `public InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }` | Prism interaction request for confirmations. |
|
||||
|
||||
**Methods throwing NotImplementedException:** `IsBusy` (getter/setter), `Activated()`, `IsDirty` (getter), `Cleanup()`, `CleanupAsync()`, `InitializeAsync()`, `InitializeAsync(object parameter)`
|
||||
|
||||
---
|
||||
|
||||
### MenuViewModel
|
||||
**Signature:** `public class MenuViewModel : BaseViewModel<IMenuViewModel>, IMenuViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `MenuViewModel(IMenuView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` | Initializes view model, sets DataContext, creates interaction requests, subscribes to `RaiseNotification` event. |
|
||||
| View | `public IMenuView View { get; private set; }` | Reference to the associated menu view. |
|
||||
| HeaderInfo | `public string HeaderInfo { get; }` | Returns constant string `"MainRegion"`. |
|
||||
| Initialize | `public override void Initialize()` | Contains placeholder code (`int i = 10;`). |
|
||||
| Initialize | `public override void Initialize(object parameter)` | Casts parameter to `IShellViewModel` and assigns to `Parent`. |
|
||||
| CreateViews | `private void CreateViews(Boolean initialize)` | Creates a `ViewDefinition` for `RegionNames.MainRegion` with `IBaseView`/`IBaseViewModel` types. Currently incomplete - view definition is not added to region manager. |
|
||||
|
||||
**Methods throwing NotImplementedException:** Same pattern as `NavigationViewModel`.
|
||||
|
||||
---
|
||||
|
||||
### ShellViewModel
|
||||
**Signature:** `public class ShellViewModel : NotificationObject, IViewerShellViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `ShellViewModel(IViewerShellView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` | Initializes view model, subscribes to `RaiseNotification`, registers `IMainView`→`MainView` and `IMainViewModel`→`MainViewModel` (singleton) with Unity container. |
|
||||
| View | `public IViewerShellView View { get; private set; }` | Reference to shell view. |
|
||||
| ContextMainRegion | `public Object ContextMainRegion { get; set; }` | Gets/sets content of `MainRegion` from `ShellView`. Raises `OnPropertyChanged` on set. |
|
||||
| IsMenuIncluded | `public bool IsMenuIncluded { get; set; }` | Bound property with `OnPropertyChanged` notification. |
|
||||
| IsNavigationIncluded | `public bool IsNavigationIncluded { get; set; }` | Bound property with `OnPropertyChanged` notification. |
|
||||
| HeaderInfo | `public string HeaderInfo { get; }` | Returns constant string `"MainRegion"`. |
|
||||
| GetRegions | `public List<FrameworkElement> GetRegions()` | Uses `Utils.GetChildrenByName` to find elements named "Region" in `MainShell`. |
|
||||
| Initialize | `public void Initialize()` | Placeholder implementation (`int i = 10;`). |
|
||||
| Initialize | `public void Initialize(object parameter)` | Placeholder implementation (`int i = 22;`). |
|
||||
| Initialize | `public void Initialize(object parameter, object model)` | Empty implementation. |
|
||||
| Activated | `public void Activated()` | Creates empty string variable. |
|
||||
|
||||
**Methods throwing NotImplementedException:** `IsBusy` (getter), `IsDirty` (getter), `Cleanup()`, `CleanupAsync()`, `InitializeAsync()`, `InitializeAsync(object parameter)`
|
||||
|
||||
---
|
||||
|
||||
### ViewerShellViewModel
|
||||
**Signature:** `public class ViewerShellViewModel : NotificationObject, IViewerShellViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `ViewerShellViewModel(IViewerShellView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` | Initializes view model, subscribes to `RaiseNotification`, registers `IViewerMainView`→`ViewerMainView` and `IViewerMainViewModel`→`ViewerMainViewModel` (singleton). |
|
||||
| ContextMainRegion | `public Object ContextMainRegion { get; set; }` | Gets/sets content of `MainRegion` from `ViewerShellView`. |
|
||||
| IsMenuIncluded | `public bool IsMenuIncluded { get; set; }` | Property with change notification. |
|
||||
| IsNavigationIncluded | `public bool IsNavigationIncluded { get; set; }` | Property with change notification. |
|
||||
| IsBusy | `public bool IsBusy { get; set; }` | **Implemented** - unlike `ShellViewModel`, this has working getter/setter with backing field `_isBusy`. |
|
||||
| GetRegions | `public List<FrameworkElement> GetRegions()` | Uses `Utils.GetChildrenByName` on `ViewerShellView.MainShell`. |
|
||||
|
||||
**Methods throwing NotImplementedException:** `IsDirty` (getter), `Cleanup()`, `CleanupAsync()`, `InitializeAsync()`, `InitializeAsync(object parameter)`, `IBasePropertyChanged.OnPropertyChanged(string propertyName)`
|
||||
|
||||
---
|
||||
|
||||
### MainViewModel
|
||||
**Signature:** `public class MainViewModel : BaseViewModel<IMainViewModel>, IMainViewModel`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `MainViewModel(IMainView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)` | Initializes view model, subscribes to `RaiseNotification` and `AssemblyListNotification` events. Registers `IMenuView`/`MenuView`, `IMenuViewModel`/`MenuViewModel`, `INavigationView`/`NavigationView`, `INavigationViewModel`/`NavigationViewModel` with Unity. |
|
||||
| View | `public IMainView View { get; private set; }` | Reference to main view. |
|
||||
| Initialize | `public override void Initialize()` | Empty implementation. |
|
||||
| Initialize | `public override void Initialize(object parameter)` | Casts parameter to `IViewerShellViewModel`, sets `Parent.IsMenuIncluded` and `Parent.IsNavigationIncluded`, subscribes to `AssemblyListNotification` event. |
|
||||
| ContextMainRegion | `public object ContextMainRegion { get; set; }` | Getter returns `null`. Setter raises `OnPropertyChanged` only. |
|
||||
| IsMenuIncluded | `public new bool IsMenuIncluded { get; set; }` | Property with backing field `_isMenuIncluded`. Marked `new`. |
|
||||
| IsNavigationIncluded | `public new bool IsNavigationIncluded { get; set; }` | Property with backing field `_isNavigationIncluded`. Marked `new`. |
|
||||
| OnAssemblyListChange | `private void OnAssemblyListChange(AssemblyListInfo e)` | Handler for `AssemblyListNotification` event. **Entire implementation is commented out.** |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
1. **Constructor Initialization Order:** All view models set `View.DataContext = this` in the constructor before any other initialization.
|
||||
2. **Event Subscription Pattern:** All view models subscribe to `RaiseNotification` event via `EventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification)` in the constructor.
|
||||
3. **Notification Transformation:** `OnRaiseNotification` handlers always transform `NotificationContentEventArgs` to a new instance containing only `Message`, `MessageDetails`, and `Image` (excluding `Title` from content object, passing it separately to `Notification.Title`).
|
||||
4. **Parent Assignment:** `Initialize(object parameter)` expects `parameter` to be castable to the appropriate parent interface (`IShellViewModel` or `IViewerShellViewModel`).
|
||||
5. **MEF Export:** `ShellViewModel` and `ViewerShellViewModel` are exported as `IShellView` with `CreationPolicy.Shared`.
|
||||
6. **Unity Registration Timing:** Type registrations (`RegisterType`) occur in constructors, meaning they execute before any view model methods.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### External Dependencies (from imports):
|
||||
- `Microsoft.Practices.Prism.Events` - `IEventAggregator`, event infrastructure
|
||||
- `Microsoft.Practices.Prism.Interactivity.InteractionRequest` - `InteractionRequest<T>`, `Notification`, `Confirmation`
|
||||
- `Microsoft.Practices.Prism.Regions` - `IRegionManager`
|
||||
- `Microsoft.Practices.Prism.ViewModel` - `NotificationObject`
|
||||
- `Microsoft.Practices.Unity` - `IUnityContainer`, `ContainerControlledLifetimeManager`
|
||||
- `System.ComponentModel.Composition` - MEF attributes (`Export`, `PartCreationPolicy`, `CreationPolicy`)
|
||||
- `System.Windows` - `FrameworkElement`
|
||||
|
||||
### Internal Dependencies:
|
||||
- `DTS.Common.Base` - `BaseViewModel<T>`, `IBaseViewModel
|
||||
Reference in New Issue
Block a user