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,61 @@
---
source_files:
- DTS Viewer/DTS.Viewer/View/DockPanelHorizontal/View/DockPanelHorizontalView.xaml.cs
generated_at: "2026-04-16T11:24:16.471740+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "5cdf7bb10effcdd4"
---
# Documentation: DockPanelHorizontalView
## 1. Purpose
`DockPanelHorizontalView` is a WPF view component representing a horizontal dock panel within the DTS Viewer application. It serves as the code-behind partial class for `DockPanelHorizontalView.xaml`, providing interaction logic for a horizontally-oriented docking layout element. This module exists to implement the `IDockPanelHorizontalView` interface, enabling it to be consumed by other components that depend on this abstraction.
---
## 2. Public Interface
### `DockPanelHorizontalView` (class)
**Namespace:** `DTS.Viewer`
**Implements:** `IDockPanelHorizontalView`
**Constructor:**
```csharp
public DockPanelHorizontalView()
```
Initializes a new instance of the `DockPanelHorizontalView` class and invokes `InitializeComponent()`, which loads and initializes the associated XAML-defined UI components.
**Note:** The base class is not explicitly declared in this file; it is defined in the corresponding XAML file (`DockPanelHorizontalView.xaml`) as is standard for WPF partial classes.
---
## 3. Invariants
- `InitializeComponent()` must be called exactly once during construction, before the view instance is used. This is enforced by the constructor implementation.
- The class must remain a `partial` class to allow the WPF compiler to merge the XAML-generated code with this code-behind.
- The view must properly implement `IDockPanelHorizontalView`, though the specific interface members are not visible in this source file.
---
## 4. Dependencies
**This module depends on:**
- `DTS.Common.Base` — Imported but no direct usage is visible in this file; likely provides base types or utilities.
- `DTS.Common.Interface` — Provides the `IDockPanelHorizontalView` interface that this class implements.
**What depends on this module:**
- Cannot be determined from this source file alone. Consumers would be components that require an `IDockPanelHorizontalView` implementation, likely within the DTS Viewer application's docking infrastructure.
---
## 5. Gotchas
- **Base class is undefined in source:** The parent class of `DockPanelHorizontalView` is declared in the XAML file (typically `UserControl`, `Window`, or a custom base). The inheritance hierarchy cannot be confirmed from this file alone.
- **Interface contract is opaque:** The members required by `IDockPanelHorizontalView` are not visible in this source. It is unclear whether the class should implement additional properties, methods, or events.
- **Unused import:** The `DTS.Common.Base` namespace is imported but no types from it are directly referenced in the visible code. This may indicate historical refactoring or base class inheritance defined in XAML.

View File

@@ -0,0 +1,114 @@
---
source_files:
- DTS Viewer/DTS.Viewer/View/DockPanelHorizontal/ViewModel/DockPanelHorizontalViewModel.cs
generated_at: "2026-04-16T11:24:34.196995+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "6bc81faa835eebdc"
---
# DockPanelHorizontalViewModel Documentation
## 1. Purpose
`DockPanelHorizontalViewModel` is a ViewModel component within a WPF/Prism-based application that manages the state and behavior of a horizontal dock panel UI element. It inherits from `BaseViewModel<IDockPanelHorizontalViewModel>` and implements `IDockPanelHorizontalViewModel`, serving as a coordinator between the view layer and the application's event system. The class provides notification/confirmation dialog support via Prism's `InteractionRequest` pattern and subscribes to application-wide `RaiseNotification` events.
---
## 2. Public Interface
### 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, stores dependencies, and subscribes to the `RaiseNotification` event via the `EventAggregator`.
### Properties
| Property | Type | Access | Description |
|----------|------|--------|-------------|
| `View` | `IDockPanelHorizontalView` | `public get; private set` | Reference to the associated view instance. |
| `NotificationRequest` | `InteractionRequest<Notification>` | `public get; private set` | Prism interaction request for displaying notifications. |
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | `public get; private set` | Prism interaction request for displaying confirmation dialogs. |
| `IsMenuIncluded` | `bool` | `public get; set` | Flag indicating whether a menu is included. |
| `IsNavigationIncluded` | `bool` | `public get; set` | Flag indicating whether navigation is included. |
| `IsBusy` | `bool` | `public get; set` | Flag indicating busy/loading state. |
| `IsDirty` | `bool` | `public get; private set` | Flag indicating unsaved changes state. |
### Events
```csharp
public event PropertyChangedEventHandler PropertyChanged;
```
Standard `INotifyPropertyChanged` event declaration.
### Methods
| Method | Return Type | Behavior |
|--------|-------------|----------|
| `Initialize()` | `void` | Throws `NotImplementedException`. |
| `Initialize(object parameter)` | `void` | Throws `NotImplementedException`. |
| `Activated()` | `void` | Throws `NotImplementedException`. |
| `Cleanup()` | `void` | Throws `NotImplementedException`. |
| `CleanupAsync()` | `Task` | Throws `NotImplementedException`. Marked with `new` keyword. |
| `Initialize(object parameter, object model)` | `void` | Throws `NotImplementedException`. Marked with `new` keyword. |
| `InitializeAsync()` | `Task` | Throws `NotImplementedException`. |
| `InitializeAsync(object parameter)` | `Task` | Throws `NotImplementedException`. |
### Private Methods
```csharp
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
```
Event handler for `RaiseNotification` events. Extracts `Message`, `MessageDetails`, `Image`, and `Title` from the received `NotificationContentEventArgs`, constructs a new `NotificationContentEventArgs` (without title), and raises the `NotificationRequest` with a `Notification` containing the reconstructed content and separate title.
---
## 3. Invariants
- The `View.DataContext` is set to `this` (the ViewModel instance) upon construction and is never changed.
- `NotificationRequest` and `ConfirmationRequest` are always non-null after construction.
- The `RaiseNotification` event subscription is established during construction and remains active for the lifetime of the ViewModel (no unsubscription is visible in the source).
- `IsDirty` can only be modified internally (private setter).
- The `_regionManager` field hides a base class member with the same name (via `new` keyword).
---
## 4. Dependencies
### This Module Depends On
| Namespace | Type(s) Used |
|-----------|--------------|
| `DTS.Common.Base` | `BaseViewModel<T>` |
| `DTS.Common.Events` | `RaiseNotification`, `NotificationContentEventArgs` |
| `DTS.Common.Interface` | `IViewModel`, `IDockPanelHorizontalViewModel` |
| `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
Not determinable from source alone. The module implements `IDockPanelHorizontalViewModel`, suggesting consumers depend on that interface rather than the concrete class directly.
---
## 5. Gotchas
1. **Most lifecycle methods are unimplemented**: `Initialize()`, `Initialize(object)`, `Activated()`, `Cleanup()`, `CleanupAsync()`, `Initialize(object, object)`, `InitializeAsync()`, and `InitializeAsync(object)` all throw `NotImplementedException`. This class appears to be a partial implementation or stub.
2. **Method hiding with `new` keyword**: `CleanupAsync()` and `Initialize(object parameter, object model)` use `new` rather than `override`, potentially hiding base class implementations. This may indicate a design inconsistency or versioning artifact.
3. **Field hiding**: The `_regionManager` field is declared with `new`, hiding a base class member. The implications of this depend on the base class implementation.
4. **Redundant object construction in `OnRaiseNotification`**: The handler constructs a new `NotificationContentEventArgs` from the received one, passing `Message`, `MessageDetails`, and `Image` to the constructor. The comment indicates this is intentional ("expects a NotificationContentEventArgsWithoutTitle object"), but the type used is `NotificationContentEventArgs`. Whether this is correct or a bug is unclear from source alone.
5. **No event unsubscription**: There is no visible unsubscription from `RaiseNotification` in any cleanup method. Since `Cleanup()` throws `NotImplementedException`, memory leaks via event subscription are possible if the base class does not handle this.
6. **Unused `Parent` property**: The `Parent` property (type `IViewModel`) is declared but never assigned or used in the visible source.