init
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelHorizontal/View/DockPanelHorizontalView.xaml.cs
|
||||
generated_at: "2026-04-16T14:03:18.194574+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 a UI container for horizontally-arranged docked elements, implementing the `IDockPanelHorizontalView` interface to integrate with the broader docking system architecture. This module exists to provide the code-behind logic for the corresponding XAML view definition.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Class: `DockPanelHorizontalView`
|
||||
|
||||
**Kind:** `partial class`
|
||||
**Implements:** `IDockPanelHorizontalView`
|
||||
**Namespace:** `DTS.Viewer`
|
||||
|
||||
#### Constructor
|
||||
|
||||
```csharp
|
||||
public DockPanelHorizontalView()
|
||||
```
|
||||
|
||||
Initializes a new instance of the `DockPanelHorizontalView` class. Invokes `InitializeComponent()`, which loads and instantiates the XAML-defined UI component tree.
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- The class is declared as `partial`, indicating that additional implementation is auto-generated from the companion XAML file (`DockPanelHorizontalView.xaml`) at build time.
|
||||
- `InitializeComponent()` must be called exactly once during construction; this is enforced by WPF's code-generation pattern.
|
||||
- The class implements `IDockPanelHorizontalView`, implying it must fulfill any contract defined by that interface (interface members are not visible in this source file).
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This module depends on:
|
||||
- `DTS.Common.Base` — imported but no specific types are referenced in this file; usage unclear from source alone
|
||||
- `DTS.Common.Interface` — provides `IDockPanelHorizontalView` interface
|
||||
- WPF Presentation Framework (implicit via `InitializeComponent()` pattern)
|
||||
|
||||
### What depends on this module:
|
||||
- Cannot be determined from this source file alone. Likely consumed by a parent container or DI container within the `DTS.Viewer` assembly.
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
- The actual UI layout, visual tree, and any named elements are defined in the companion XAML file (`DockPanelHorizontalView.xaml`), which is not included here. The behavior and structure of this view cannot be fully understood without that file.
|
||||
- The `IDockPanelHorizontalView` interface contract is not visible in this source; any required interface members (properties, methods, events) are not shown.
|
||||
- The import of `DTS.Common.Base` is unused in this file—this may indicate dead code, a historical remnant, or types used in the XAML portion.
|
||||
@@ -0,0 +1,105 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelHorizontal/ViewModel/DockPanelHorizontalViewModel.cs
|
||||
generated_at: "2026-04-16T14:03:50.492383+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 MVVM architecture, responsible for managing the state and behavior of a horizontal dock panel view. It serves as a mediator between the view (`IDockPanelHorizontalView`) and the application's infrastructure (region navigation, event aggregation, dependency injection). The class currently provides a functional notification system while the majority of its lifecycle methods remain unimplemented stubs.
|
||||
|
||||
---
|
||||
|
||||
## 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 interaction requests, and subscribes to the `RaiseNotification` event.
|
||||
|
||||
### Properties
|
||||
|
||||
| Property | Type | Access | Description |
|
||||
|----------|------|--------|-------------|
|
||||
| `View` | `IDockPanelHorizontalView` | `get` | 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. |
|
||||
| `IsNavigationIncluded` | `bool` | `get; set` | Flag indicating whether navigation is included. |
|
||||
| `IsBusy` | `bool` | `get; set` | Indicates if the ViewModel is in a busy state. |
|
||||
| `IsDirty` | `bool` | `get; private set` | Indicates if there are unsaved changes. |
|
||||
|
||||
### Events
|
||||
```csharp
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
```
|
||||
Standard property-changed event for data binding.
|
||||
|
||||
### Methods (Override/New)
|
||||
|
||||
| Method | Signature | Implementation Status |
|
||||
|--------|-----------|----------------------|
|
||||
| `Initialize` | `override void Initialize()` | **Throws `NotImplementedException`** |
|
||||
| `Initialize` | `override void Initialize(object parameter)` | **Throws `NotImplementedException`** |
|
||||
| `Initialize` | `new void Initialize(object parameter, object model)` | **Throws `NotImplementedException`** |
|
||||
| `InitializeAsync` | `override Task InitializeAsync()` | **Throws `NotImplementedException`** |
|
||||
| `InitializeAsync` | `override Task InitializeAsync(object parameter)` | **Throws `NotImplementedException`** |
|
||||
| `Activated` | `override void Activated()` | **Throws `NotImplementedException`** |
|
||||
| `Cleanup` | `override void Cleanup()` | **Throws `NotImplementedException`** |
|
||||
| `CleanupAsync` | `new Task CleanupAsync()` | **Throws `NotImplementedException`** |
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- **DataContext Binding**: The `View.DataContext` is always set to `this` upon construction.
|
||||
- **Event Subscription**: The `RaiseNotification` event subscription is established in the constructor and remains active for the lifetime of the ViewModel.
|
||||
- **IsDirty Encapsulation**: The `IsDirty` property can only be modified internally (private setter).
|
||||
- **Base Class Contract**: Inherits from `BaseViewModel<IDockPanelHorizontalViewModel>` and implements `IDockPanelHorizontalViewModel`.
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### External Dependencies (from imports)
|
||||
- **`Microsoft.Practices.Prism.Events`** - `IEventAggregator` for pub/sub event handling
|
||||
- **`Microsoft.Practices.Prism.Interactivity.InteractionRequest`** - `InteractionRequest<T>`, `Notification`, `Confirmation` for UI dialogs
|
||||
- **`Microsoft.Practices.Prism.Regions`** - `IRegionManager` for region-based navigation
|
||||
- **`Microsoft.Practices.Unity`** - `IUnityContainer` for dependency injection
|
||||
|
||||
### Internal Dependencies
|
||||
- **`DTS.Common.Base`** - Provides `BaseViewModel<T>`
|
||||
- **`DTS.Common.Events`** - Provides `RaiseNotification` event and `NotificationContentEventArgs`
|
||||
- **`DTS.Common.Interface`** - Provides `IViewModel`, `IDockPanelHorizontalViewModel`, `IDockPanelHorizontalView`
|
||||
|
||||
### Dependents
|
||||
- Cannot be determined from this source file alone.
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
1. **Incomplete Implementation**: All lifecycle methods (`Initialize`, `InitializeAsync`, `Activated`, `Cleanup`, `CleanupAsync`) throw `NotImplementedException`. Calling these will crash the application.
|
||||
|
||||
2. **Method Hiding with `new` Keyword**:
|
||||
- `CleanupAsync()` and `Initialize(object, object)` use `new` rather than `override`, meaning they hide base class members. Calls through a base class reference will invoke the base implementation, not these methods.
|
||||
|
||||
3. **Field Hiding**: The `_regionManager` field is declared with `new`, hiding any base class field of the same name. This may cause confusion about which instance is being used.
|
||||
|
||||
4. **Redundant PropertyChanged Event**: The class declares `PropertyChanged` event, but `BaseViewModel` likely already implements `INotifyPropertyChanged`. This could cause issues if the base relies on its own event declaration.
|
||||
|
||||
5. **Legacy Prism Version**: Uses `Microsoft.Practices.Prism` namespace, indicating an older version of Prism (pre-6.x). Modern Prism uses `Prism` namespace.
|
||||
|
||||
6. **Unused ConfirmationRequest**: `ConfirmationRequest` is instantiated but never raised anywhere in this class. Its intended usage is unclear from this source.
|
||||
|
||||
7. **Unused Private Members**: `Parent`, `_regionManager`, and `UnityContainer` are stored but never used in any implemented method.
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelVertical/View/DockPanelVerticalView.xaml.cs
|
||||
generated_at: "2026-04-16T14:04:31.162736+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "dd7d632d568da85b"
|
||||
---
|
||||
|
||||
# DockPanelVerticalView Documentation
|
||||
|
||||
## 1. Purpose
|
||||
|
||||
`DockPanelVerticalView` is a WPF view component representing a vertical dock panel user interface element. It serves as the code-behind partial class for `DockPanelVerticalView.xaml` and implements the `IDockPanelVerticalView` interface, indicating it follows an interface-based architecture pattern (likely MVVM or MVP) within the DTS Viewer application. This module exists to provide a container or layout surface for vertically-arranged dockable content.
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Class: `DockPanelVerticalView`
|
||||
|
||||
**Namespace:** `DTS.Viewer`
|
||||
|
||||
**Implements:** `IDockPanelVerticalView`
|
||||
|
||||
| Member | Signature | Description |
|
||||
|--------|-----------|-------------|
|
||||
| Constructor | `public DockPanelVerticalView()` | Default parameterless constructor. Initializes the component by calling `InitializeComponent()`, which loads the associated XAML layout. |
|
||||
|
||||
**Note:** The interface `IDockPanelVerticalView` is implemented but its members (if any) are not visible in this source file. The class appears to have no additional public members beyond the constructor.
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
- The class is a `partial` class, meaning it must always be paired with its XAML counterpart (`DockPanelVerticalView.xaml`) which provides the visual definition.
|
||||
- `InitializeComponent()` must be called in the constructor for the XAML-defined UI elements to be instantiated.
|
||||
- The class must implement `IDockPanelVerticalView` to satisfy the interface contract (specific interface members are not visible in this source).
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This module depends on:
|
||||
- `DTS.Common.Base` — imported but no specific types are explicitly referenced in the visible code
|
||||
- `DTS.Common.Interface` — provides `IDockPanelVerticalView` interface
|
||||
- WPF infrastructure (implicit via `InitializeComponent()` pattern)
|
||||
|
||||
### What depends on this module:
|
||||
- Cannot be determined from source alone. Likely consumed by a parent container, view manager, or dependency injection container within the DTS Viewer application.
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
- **Unused import:** The `using DTS.Common.Base;` directive is present but no types from this namespace are explicitly used in the visible code. This may indicate dead code, a historical artifact, or types used only in the XAML file.
|
||||
- **Interface contract unknown:** The specific members required by `IDockPanelVerticalView` are not visible in this source, making it unclear whether the class fully satisfies the interface or if additional members exist elsewhere (e.g., in another partial class file).
|
||||
- **Behavior delegated to XAML:** All actual UI behavior and layout logic resides in the associated XAML file, which is not provided. The code-behind contains no event handlers, commands, or business logic.
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer/View/DockPanelVertical/ViewModel/DockPanelVerticalViewModel.cs
|
||||
generated_at: "2026-04-16T14:04:21.621857+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 a container view model that manages notification and confirmation dialogs via Prism's `InteractionRequest` pattern, and exposes state properties for menu and navigation inclusion. The class inherits from `BaseViewModel<IDockPanelVerticalViewModel>` and implements the `IDockPanelVerticalViewModel` interface, participating in Prism's region navigation and event aggregation system.
|
||||
|
||||
---
|
||||
|
||||
## 2. Public Interface
|
||||
|
||||
### Constructor
|
||||
|
||||
```csharp
|
||||
public DockPanelVerticalViewModel(
|
||||
IDockPanelVerticalView view,
|
||||
IRegionManager regionManager,
|
||||
IEventAggregator eventAggregator,
|
||||
IUnityContainer unityContainer)
|
||||
```
|
||||
Initializes the view model, sets the View's DataContext to itself, creates `NotificationRequest` and `ConfirmationRequest` instances, and subscribes to the `RaiseNotification` event via the event aggregator.
|
||||
|
||||
### Properties
|
||||
|
||||
| Property | Type | Access |
|
||||
|----------|------|--------|
|
||||
| `View` | `IDockPanelVerticalView` | `public get; private set` |
|
||||
| `NotificationRequest` | `InteractionRequest<Notification>` | `public get; private set` |
|
||||
| `ConfirmationRequest` | `InteractionRequest<Confirmation>` | `public get; private set` |
|
||||
| `IsMenuIncluded` | `bool` | `public get; set` |
|
||||
| `IsNavigationIncluded` | `bool` | `public get; set` |
|
||||
| `IsBusy` | `bool` | `public get; set` |
|
||||
| `IsDirty` | `bool` | `public get; private set` |
|
||||
|
||||
### Events
|
||||
|
||||
```csharp
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
```
|
||||
Declared but **never invoked** within this class.
|
||||
|
||||
### Lifecycle Methods (All Throw `NotImplementedException`)
|
||||
|
||||
| Method | Signature |
|
||||
|--------|-----------|
|
||||
| `Initialize()` | `public override void Initialize()` |
|
||||
| `Initialize(object)` | `public override void Initialize(object parameter)` |
|
||||
| `Activated()` | `public override void Activated()` |
|
||||
| `Cleanup()` | `public override void Cleanup()` |
|
||||
| `CleanupAsync()` | `public new Task CleanupAsync()` |
|
||||
| `Initialize(object, object)` | `public new void Initialize(object parameter, object model)` |
|
||||
| `InitializeAsync()` | `public override Task InitializeAsync()` |
|
||||
| `InitializeAsync(object)` | `public override Task InitializeAsync(object parameter)` |
|
||||
|
||||
### Private Event Handler
|
||||
|
||||
```csharp
|
||||
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
|
||||
```
|
||||
Handles `RaiseNotification` events by creating a new `NotificationContentEventArgs` (without title) and raising the `NotificationRequest` with both content and title extracted from the original event args.
|
||||
|
||||
---
|
||||
|
||||
## 3. Invariants
|
||||
|
||||
1. **DataContext Binding**: The View's `DataContext` is always set to the ViewModel instance upon construction.
|
||||
2. **InteractionRequest Initialization**: `NotificationRequest` and `ConfirmationRequest` are never null after construction.
|
||||
3. **Event Subscription**: The view model is always subscribed to `RaiseNotification` event after construction (no unsubscribe logic is visible).
|
||||
4. **IsDirty Encapsulation**: `IsDirty` can only be modified internally (private setter).
|
||||
|
||||
---
|
||||
|
||||
## 4. Dependencies
|
||||
|
||||
### This Module Depends On:
|
||||
- `DTS.Common.Base` — Provides `BaseViewModel<T>`
|
||||
- `DTS.Common.Events` — Provides `RaiseNotification` event class and `NotificationContentEventArgs`
|
||||
- `DTS.Common.Interface` — Provides `IDockPanelVerticalViewModel`, `IViewModel`, `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:
|
||||
**Cannot be determined from source alone.** The consumers of `IDockPanelVerticalViewModel` or `DockPanelVerticalViewModel` are not visible in this file.
|
||||
|
||||
---
|
||||
|
||||
## 5. Gotchas
|
||||
|
||||
1. **Incomplete Implementation**: All lifecycle methods (`Initialize`, `Activated`, `Cleanup`, and their async variants) throw `NotImplementedException`. This class appears to be a stub or work-in-progress.
|
||||
|
||||
2. **Method Hiding with `new` Keyword**:
|
||||
- `CleanupAsync()` and `Initialize(object, object)` use `new` instead of `override`, hiding base class members. This may cause unexpected behavior when calling through base class references.
|
||||
|
||||
3. **Field Shadowing**: The `_regionManager` field is declared with `new`, suggesting it shadows a base class member. The reason for this is unclear from source alone.
|
||||
|
||||
4. **Unused `PropertyChanged` Event**: The `PropertyChanged` event is declared but never raised. Property setters for `IsMenuIncluded`, `IsNavigationIncluded`, and `IsBusy` do not trigger change notifications, which may break UI binding updates.
|
||||
|
||||
5. **No Unsubscribe Logic**: The subscription to `RaiseNotification` event in the constructor has no corresponding unsubscribe in any cleanup method. This could cause memory leaks if view model instances are not properly garbage collected.
|
||||
|
||||
6. **Data Transformation in `OnRaiseNotification`**: The handler creates a new `NotificationContentEventArgs` object from the received one, separating title from content. This transformation may be intentional but appears redundant without additional context.
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
Reference in New Issue
Block a user