init
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelVertical/View/DockPanelVerticalView.xaml.cs
|
||||
generated_at: "2026-04-16T11:25:25.151183+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "dd7d632d568da85b"
|
||||
---
|
||||
|
||||
# Documentation: DockPanelVerticalView
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
`DockPanelVerticalView` is a WPF view component that serves as the code-behind for a XAML-defined vertical dock panel user interface. It implements the `IDockPanelVerticalView` interface, enabling abstraction and likely facilitating dependency injection or MVVM pattern integration within the DTS Viewer application.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Class: `DockPanelVerticalView`
|
||||
**Namespace:** `DTS.Viewer`
|
||||
**Implements:** `IDockPanelVerticalView`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `public DockPanelVerticalView()` | Initializes a new instance of the view and calls `InitializeComponent()` to load the associated XAML layout. |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- `InitializeComponent()` must be called exactly once during construction for the XAML-defined UI elements to be instantiated.
|
||||
- The class is `partial`, indicating it must be paired with a corresponding XAML file (`DockPanelVerticalView.xaml`) that defines the visual layout.
|
||||
- The view must implement `IDockPanelVerticalView` to satisfy the interface contract (specific interface members are not visible in this source file).
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This module depends on:
|
||||
- `DTS.Common.Base` — Imported but no types from this namespace are directly referenced in the visible source.
|
||||
- `DTS.Common.Interface` — Provides the `IDockPanelVerticalView` interface that this class implements.
|
||||
- **WPF infrastructure** — Implicit dependency on `System.Windows` (inferred from `InitializeComponent()` pattern and `.xaml.cs` file extension).
|
||||
|
||||
### What depends on this module:
|
||||
- **Not determinable from source alone.** Consumers would typically be parent views, view composition logic, or an IoC container registering this view.
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
- **Base class not visible:** The source does not explicitly declare a base class. As a `partial` class paired with XAML, the base class is likely defined in the XAML root element (commonly `UserControl` or `Window`). The exact base type cannot be confirmed from this file alone.
|
||||
- **Empty code-behind:** The class contains no additional logic beyond initialization. Any behavior (event handlers, data binding setup, etc.) is either in the XAML file, a associated ViewModel, or injected elsewhere.
|
||||
- **Unused import:** `DTS.Common.Base` is imported but no types from it are referenced in the visible code. This may indicate legacy code, a removed feature, or types used only in the XAML portion.
|
||||
@@ -0,0 +1,103 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelVertical/ViewModel/DockPanelVerticalViewModel.cs
|
||||
generated_at: "2026-04-16T11:25:25.613899+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "0185c1c3d29b204b"
|
||||
---
|
||||
|
||||
# DockPanelVerticalViewModel Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
`DockPanelVerticalViewModel` is a ViewModel component for a vertical dock panel UI element within a WPF/Prism-based application. It serves as the data context for `IDockPanelVerticalView`, managing notification/confirmation dialogs and exposing panel configuration state flags. The class inherits from `BaseViewModel<IDockPanelVerticalViewModel>` and integrates with Prism's event aggregation and region management infrastructure.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Constructor
|
||||
|
||||
```csharp
|
||||
public DockPanelVerticalViewModel(
|
||||
IDockPanelVerticalView view,
|
||||
IRegionManager regionManager,
|
||||
IEventAggregator eventAggregator,
|
||||
IUnityContainer unityContainer)
|
||||
```
|
||||
Initializes the ViewModel, sets the View's DataContext to itself, creates interaction requests, and subscribes to the `RaiseNotification` event.
|
||||
|
||||
### Properties
|
||||
|
||||
| Property | Type | Access | Description |
|
||||
|----------|------|--------|-------------|
|
||||
| `View` | `IDockPanelVerticalView` | `get` | Reference to the associated view instance. |
|
||||
| `NotificationRequest` | `InteractionRequest<Notification>` | `get` | Prism interaction request for displaying notifications. |
|
||||
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | `get` | Prism interaction request for displaying confirmations. |
|
||||
| `IsMenuIncluded` | `bool` | `get/set` | Flag indicating whether a menu is included in the panel. |
|
||||
| `IsNavigationIncluded` | `bool` | `get/set` | Flag indicating whether navigation is included in the panel. |
|
||||
| `IsBusy` | `bool` | `get/set` | Busy state indicator. |
|
||||
| `IsDirty` | `bool` | `get` (private set) | Dirty state indicator; read-only externally. |
|
||||
|
||||
### Events
|
||||
|
||||
```csharp
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
```
|
||||
Declared but **never invoked** within this class.
|
||||
|
||||
### Methods
|
||||
|
||||
| Method | Return Type | Behavior |
|
||||
|--------|-------------|----------|
|
||||
| `Initialize()` | `void` | Throws `NotImplementedException`. |
|
||||
| `Initialize(object parameter)` | `void` | Throws `NotImplementedException`. |
|
||||
| `Initialize(object parameter, object model)` | `void` | Throws `NotImplementedException`. Uses `new` keyword. |
|
||||
| `InitializeAsync()` | `Task` | Throws `NotImplementedException`. |
|
||||
| `InitializeAsync(object parameter)` | `Task` | Throws `NotImplementedException`. |
|
||||
| `Activated()` | `void` | Throws `NotImplementedException`. |
|
||||
| `Cleanup()` | `void` | Throws `NotImplementedException`. |
|
||||
| `CleanupAsync()` | `Task` | Throws `NotImplementedException`. Uses `new` keyword. |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **DataContext Binding**: The View's `DataContext` is always set to `this` ViewModel instance upon construction.
|
||||
- **Event Subscription**: The ViewModel subscribes to `RaiseNotification` event during construction; the subscription lifetime is tied to the EventAggregator's scope.
|
||||
- **Notification Transformation**: `OnRaiseNotification` transforms `NotificationContentEventArgs` (with title) into `NotificationContentEventArgs` (without title) plus a separate Title string when raising the notification request.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This module depends on:
|
||||
- `DTS.Common.Base` — `BaseViewModel<T>`
|
||||
- `DTS.Common.Events` — `RaiseNotification` event, `NotificationContentEventArgs`
|
||||
- `DTS.Common.Interface` — `IViewModel`, `IDockPanelVerticalViewModel`, `IDockPanelVerticalView`
|
||||
- `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** — No consumers are visible in this file. Likely consumed by View implementations and/or DI container registrations.
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
1. **Incomplete Implementation**: All lifecycle methods (`Initialize`, `InitializeAsync`, `Activated`, `Cleanup`, `CleanupAsync`) throw `NotImplementedException`. This class appears to be a stub or work-in-progress.
|
||||
|
||||
2. **Member Hiding**:
|
||||
- The `_regionManager` field uses `new`, hiding a base class member of the same name.
|
||||
- `CleanupAsync()` and `Initialize(object parameter, object model)` also use `new`, hiding base implementations rather than overriding them.
|
||||
|
||||
3. **Unused `PropertyChanged` Event**: The event is declared but never raised. If property change notification is expected by consumers, it will not function.
|
||||
|
||||
4. **Unused `ConfirmationRequest`**: The `ConfirmationRequest` property is instantiated but never raised anywhere in this class.
|
||||
|
||||
5. **Unused State Properties**: `IsMenuIncluded`, `IsNavigationIncluded`, `IsBusy`, and `IsDirty` are declared but never read or written within this class (other than being auto-initialized).
|
||||
|
||||
6. **Potential Memory Leak**: The `RaiseNotification` event subscription does not appear to be unsubscribed in cleanup (though cleanup throws anyway). If the EventAggregator uses weak references, this may be safe; otherwise, it could cause memory retention issues.
|
||||
Reference in New Issue
Block a user