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-16T11:25:05.068358+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "4b4942c6e8f5eadd"
---
# Documentation: NavigationView
## 1. Purpose
This module defines the code-behind class for the `NavigationView` component within the DTS Viewer application. It serves as a WPF User Control responsible for the visual presentation of navigation elements. Its primary role is to implement the `INavigationView` interface, bridging the gap between the XAML layout definition and the application's navigation logic.
## 2. Public Interface
### Class: `NavigationView`
**Inherits:** `INavigationView` (from `DTS.Common.Interface`)
**Type:** `partial` class
#### Constructor: `NavigationView()`
* **Signature:** `public NavigationView()`
* **Behavior:** Initializes the component. It calls the standard WPF `InitializeComponent()` method, which loads the associated XAML markup (`NavigationView.xaml`) required to render the view.
## 3. Invariants
* **WPF Initialization:** The `InitializeComponent()` method must be called exactly once upon instantiation to ensure the UI elements defined in XAML are created.
* **Interface Compliance:** As this class implements `INavigationView`, it must satisfy the contract defined in `DTS.Common.Interface.INavigationView`. (Note: The specific members of this interface are not visible in the provided source).
## 4. Dependencies
* **Imports:**
* `DTS.Common.Interface`: Used for the `INavigationView` interface.
* **Internal Dependencies:**
* `NavigationView.xaml`: This is a code-beind file; it relies on a corresponding XAML file to define the actual UI structure.
* Implicit WPF Assemblies: Relies on `System.Windows` (specifically `System.Windows.Controls.UserControl` behavior) for `InitializeComponent()`.
## 5. Gotchas
* **Missing Logic Implementation:** The source file contains no explicit implementation of the `INavigationView` interface members. It is unclear from this source alone whether the interface is a marker interface (empty) or if the implementation is expected elsewhere (e.g., via explicit interface implementation not shown, or if the file provided is incomplete).
* **XAML Dependency:** The functionality and visual behavior of this view are entirely dependent on the associated `NavigationView.xaml` file, which is not included here. The C# code acts purely as a bridge.

View File

@@ -0,0 +1,106 @@
---
source_files:
- DTS Viewer/DTS.Viewer/View/Navigation/ViewModel/NavigationViewModel.cs
generated_at: "2026-04-16T11:24:52.139730+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 events via `IEventAggregator` and exposing a `ContextNavigationRegion` property for dynamically setting navigation content. This class inherits from `BaseViewModel<INavigationViewModel>` and implements the `INavigationViewModel` interface.
---
## 2. Public Interface
### Constructor
```csharp
public NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
```
Initializes the view model with its associated view and Prism infrastructure dependencies. Sets the view's `DataContext` to itself, initializes interaction requests, and subscribes to the `RaiseNotification` event.
### Properties
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `NavigationView` | `INavigationView` | `get; private set;` | The associated navigation view instance. |
| `NotificationRequest` | `InteractionRequest<Notification>` | `get; private set;` | Interaction request for displaying notifications. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | `get; private set;` | Interaction request for displaying confirmations. |
| `ContextNavigationRegion` | `object` | `get; set;` | Gets or sets the content of the `NavigationRegion` on the underlying view. Raises `OnPropertyChanged` on set. |
| `HeaderInfo` | `string` | `get;` | Returns the constant string `"NavigationRegion"`. |
| `IsBusy` | `bool` | `get; set;` | **Throws `NotImplementedException`** in both getter and setter. |
| `IsDirty` | `bool` | `get;` | **Throws `NotImplementedException`** in getter. |
### Events
```csharp
public new event PropertyChangedEventHandler PropertyChanged;
```
Hides the base class event. Raised via the private `OnPropertyChanged(string propertyName)` method.
### Methods
| Method | Return Type | Description |
|--------|-------------|-------------|
| `Initialize()` | `void` | Empty override; performs no initialization. |
| `Initialize(object parameter)` | `void` | Sets the `Parent` property by casting `parameter` to `IShellViewModel`. |
| `Activated()` | `void` | **Throws `NotImplementedException`**. |
| `Cleanup()` | `void` | **Throws `NotImplementedException`**. |
| `CleanupAsync()` | `Task` | **Throws `NotImplementedException`**. |
| `InitializeAsync()` | `Task` | **Throws `NotImplementedException`**. |
| `InitializeAsync(object parameter)` | `Task` | **Throws `NotImplementedException`**. |
### Private Methods
```csharp
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
```
Event handler for `RaiseNotification` events. Transforms `NotificationContentEventArgs` into a `NotificationContentEventArgs` (without title) and raises the `NotificationRequest` with separate content and title.
---
## 3. Invariants
- `NavigationView` is assigned in the constructor and never reassigned.
- `Parent` is only set via `Initialize(object parameter)` and must be castable to `IShellViewModel`.
- The `RaiseNotification` event subscription is established at construction time and remains active for the lifetime of the view model.
- `ContextNavigationRegion` assumes the underlying `NavigationView` can be cast to the concrete `NavigationView` type to access `NavigationRegion.Content`.
---
## 4. Dependencies
### This module depends on:
- `DTS.Common.Base` — Provides `BaseViewModel<T>`
- `DTS.Common.Events` — Provides `RaiseNotification` event and `NotificationContentEventArgs`
- `DTS.Common.Interface` — Provides `INavigationViewModel`, `INavigationView`, `IShellViewModel`
- `Microsoft.Practices.Prism.Events` — Provides `IEventAggregator`
- `Microsoft.Practices.Prism.Interactivity.InteractionRequest` — Provides `InteractionRequest<T>`, `Notification`, `Confirmation`
- `Microsoft.Practices.Prism.Regions` — Provides `IRegionManager`
- `Microsoft.Practices.Unity` — Provides `IUnityContainer`
### What depends on this module:
- Cannot be determined from source alone (no consumers visible in this file).
---
## 5. Gotchas
1. **Incomplete Implementation**: Multiple methods (`Activated`, `Cleanup`, `CleanupAsync`, `InitializeAsync`, `InitializeAsync(object parameter)`) and properties (`IsBusy`, `IsDirty`) throw `NotImplementedException`. This class appears to be partially implemented.
2. **Member Hiding**: The `new` keyword is used to hide base class members (`PropertyChanged`, `OnPropertyChanged`, `IsBusy`, `IsDirty`, `CleanupAsync`). This may indicate a design issue or conflict with the base `BaseViewModel<T>` implementation.
3. **Stale XML Documentation**: The constructor's XML comment states "Creates a new instance of the TechnologyDoFrontEditViewModel" — this appears to be a copy-paste error from another view model.
4. **Unsafe Cast in ContextNavigationRegion**: The property directly casts `INavigationView` to the concrete `NavigationView` type:
```csharp
((NavigationView)NavigationView).NavigationRegion.Content
```
This will throw an `InvalidCastException` at runtime if the injected view is not exactly of type `NavigationView`.
5. **Event Transformation Logic**: `OnRaiseNotification` creates a new `NotificationContentEventArgs` from the received event args, extracting `Message`, `MessageDetails`, and `Image` while separating `Title`. This transformation may lose data if additional properties exist on the source event args.