This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
---
source_files:
- DTS Viewer/DTS.Viewer/View/Navigation/View/NavigationView.xaml.cs
generated_at: "2026-04-16T14:04:13.894846+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "4b4942c6e8f5eadd"
---
# Documentation: NavigationView
## 1. Purpose
This module serves as the code-behind file for the `NavigationView` component within the `DTS.Viewer` application. It acts as the UI container for navigation controls, initializing the XAML component tree. It implements the `INavigationView` interface, suggesting it is part of a larger navigation architecture (likely MVP or MVVM) where the view is abstracted behind an interface for decoupling or testing purposes.
## 2. Public Interface
### Class: `NavigationView`
**Inherits:** `INavigationView` (from `DTS.Common.Interface`)
**Type:** `partial` class
#### Constructor
* **`public NavigationView()`**
* **Description:** Default constructor. Calls `InitializeComponent()`, which loads and initializes the associated XAML layout defined in `NavigationView.xaml`.
## 3. Invariants
* **Initialization Order:** The `InitializeComponent()` method is invoked immediately upon construction. The object is not fully functional until this method completes.
* **Partial Definition:** This class is defined as `partial`. It relies on auto-generated code (typically from `NavigationView.g.i.cs`) created by the WPF build process to provide the implementation of `InitializeComponent` and connect to the XAML elements.
## 4. Dependencies
* **External Dependencies:**
* `DTS.Common.Interface`: Required for the `INavigationView` interface definition.
* **WPF System Assemblies:** Implicitly depends on `System.Windows.Controls` (and related namespaces) for `UserControl` functionality, though not explicitly visible in the `using` statements (likely defined in the XAML root element).
* **File Dependencies:**
* **`NavigationView.xaml`**: This code-beind file is tightly coupled to a corresponding XAML file which defines the visual structure.
## 5. Gotchas
* **Missing Interface Implementation Details:** The source code shows that `NavigationView` implements `INavigationView`, but it does not explicitly implement any methods or properties in this file. The implementation is likely defined explicitly in the XAML (via bindings) or is expected to be an empty marker interface, but this cannot be confirmed without the interface definition.
* **Logic Location:** There is no logic present in this file other than initialization. Developers should look to the associated XAML file for UI element definitions and potentially the ViewModel/Presenter for actual behavior logic.

View File

@@ -0,0 +1,101 @@
---
source_files:
- DTS Viewer/DTS.Viewer/View/Navigation/ViewModel/NavigationViewModel.cs
generated_at: "2026-04-16T14:03:49.797600+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "a00beb6f74b53389"
---
# Documentation: NavigationViewModel
## 1. Purpose
`NavigationViewModel` is a Prism-based ViewModel responsible for managing the navigation region within the DTS Viewer application's shell. It serves as a mediator between the `INavigationView` and the application's navigation infrastructure, handling notification popups via `InteractionRequest` and providing a bindable `ContextNavigationRegion` property for dynamic content injection. The class inherits from `BaseViewModel<INavigationViewModel>` and implements `INavigationViewModel`.
---
## 2. Public Interface
### Constructor
```csharp
public NavigationViewModel(
INavigationView 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 via the `EventAggregator`.
### Properties
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `NavigationView` | `INavigationView` | `get` | Stores the associated view instance. |
| `NotificationRequest` | `InteractionRequest<Notification>` | `get` | Used to raise notification dialogs. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | `get` | Used to raise confirmation dialogs. |
| `ContextNavigationRegion` | `object` | `get/set` | Gets or sets the content of the `NavigationRegion` on the view. Raises `OnPropertyChanged` on set. |
| `HeaderInfo` | `string` | `get` | Returns the constant string `"NavigationRegion"`. |
| `IsBusy` | `bool` | `get/set` | **Throws `NotImplementedException`**. |
| `IsDirty` | `bool` | `get` | **Throws `NotImplementedException`**. |
### Methods
| Method | Return Type | Description |
|--------|-------------|-------------|
| `Initialize()` | `void` | Override. Empty implementation. |
| `Initialize(object parameter)` | `void` | Override. Casts `parameter` to `IShellViewModel` and assigns to `Parent` field. |
| `Activated()` | `void` | Override. **Throws `NotImplementedException`**. |
| `Cleanup()` | `void` | Override. **Throws `NotImplementedException`**. |
| `CleanupAsync()` | `Task` | **Throws `NotImplementedException`**. |
| `InitializeAsync()` | `Task` | Override. **Throws `NotImplementedException`**. |
| `InitializeAsync(object parameter)` | `Task` | Override. **Throws `NotImplementedException`**. |
### Events
| Event | Type | Description |
|-------|------|-------------|
| `PropertyChanged` | `PropertyChangedEventHandler` | Declared with `new` keyword, hiding the base implementation. Raised via `OnPropertyChanged`. |
---
## 3. Invariants
- `NavigationView` is set once in the constructor and never reassigned.
- `ContextNavigationRegion` always accesses `((NavigationView)NavigationView).NavigationRegion.Content`, requiring the concrete `NavigationView` type.
- `HeaderInfo` always returns the literal string `"NavigationRegion"`.
- The `RaiseNotification` event subscription is established at construction time and never unsubscribed.
- `Parent` is only set via `Initialize(object parameter)` and expects an `IShellViewModel` instance.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base``BaseViewModel<T>`
- `DTS.Common.Events``RaiseNotification` event, `NotificationContentEventArgs`, `NotificationContentEventArgsWithoutTitle` (implied by usage)
- `DTS.Common.Interface``INavigationViewModel`, `INavigationView`, `IShellViewModel`
- `Microsoft.Practices.Prism.Events``IEventAggregator`
- `Microsoft.Practices.Prism.Interactivity.InteractionRequest``InteractionRequest<T>`, `Notification`, `Confirmation`
- `Microsoft.Practices.Prism.Regions``IRegionManager`
- `Microsoft.Practices.Unity``IUnityContainer`
### What depends on this module:
- **Unclear from source alone** — The `IShellViewModel` interface suggests a parent shell consumes this ViewModel, but the exact consumers are not visible in this file.
---
## 5. Gotchas
1. **Many members throw `NotImplementedException`**: `IsBusy`, `IsDirty`, `Activated()`, `Cleanup()`, `CleanupAsync()`, `InitializeAsync()`, and `InitializeAsync(object parameter)` are all stubs that will crash if invoked. This indicates incomplete implementation.
2. **Broken abstraction in `ContextNavigationRegion`**: The property casts `INavigationView` to the concrete `NavigationView` type to access `NavigationRegion.Content`. This violates the interface contract and creates tight coupling.
3. **Incorrect XML documentation**: The constructor's XML comment states it "Creates a new instance of the TechnologyDoFrontEditViewModel" — this is a copy-paste error and does not match the actual class name.
4. **Event hiding**: The `PropertyChanged` event and `OnPropertyChanged` method are declared with `new`, hiding the base class implementation. This could lead to unexpected behavior if consumers expect the base event to fire.
5. **No event unsubscription**: The `RaiseNotification` event subscription in the constructor has no corresponding unsubscription in `Cleanup()` (which throws anyway), potentially causing memory leaks.
6. **Commented-out dead code**: A `GetRegions()` method is entirely commented out, suggesting unfinished or abandoned functionality.