Files
DP44/enriched-partialglm/DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.GraphList/View.md

71 lines
3.9 KiB
Markdown
Raw Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.GraphList/View/ExportGraphMainView.xaml.cs
- DTS Viewer/DTS.Viewer.Modules/DTS.Viewer.GraphList/View/GraphMainView.xaml.cs
generated_at: "2026-04-16T11:11:08.452052+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "e0305153f9f5be9f"
---
# Documentation: DTS.Viewer.GraphList Views
## 1. Purpose
This module contains WPF code-behind files for two graph-related views in the DTS Viewer application: `ExportGraphMainView` and `GraphMainView`. Both views implement corresponding interfaces from `DTS.Common.Interface` and provide interaction logic for their respective XAML counterparts. Their primary runtime behavior is to intercept and suppress the `ApplicationCommands.Undo` command, preventing undo operations from propagating further in the command routing system.
---
## 2. Public Interface
### `ExportGraphMainView` (class)
**Implements:** `IExportGraphMainView`
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `public ExportGraphMainView()` | Initializes the XAML component via `InitializeComponent()` and registers a `CommandBinding` for `ApplicationCommands.Undo`. Both the Execute and CanExecute handlers set `e.Handled = true` without performing any other action. |
---
### `GraphMainView` (class)
**Implements:** `IGraphMainView`
| Member | Signature | Description |
|--------|-----------|-------------|
| Constructor | `public GraphMainView()` | Initializes the XAML component via `InitializeComponent()` and registers a `CommandBinding` for `ApplicationCommands.Undo`. Both the Execute and CanExecute handlers set `e.Handled = true` without performing any other action. |
**Note:** The `GraphMainView` class contains commented-out code referencing:
- `root.IsChecked` (presumably a UI element)
- `TvTestChannels.Focus()` (a method call)
- A commented-out method `SetTvFocus()`
---
## 3. Invariants
1. **Partial Class Structure:** Both `ExportGraphMainView` and `GraphMainView` are declared as `partial` classes, implying the existence of XAML-generated counterparts that must be present at compile time.
2. **Undo Command Suppression:** Both views guarantee that `ApplicationCommands.Undo` will always be marked as handled (`e.Handled = true`) in both Execute and CanExecute handlers, effectively disabling undo functionality within these views.
3. **Interface Implementation:** Each view must implement its respective interface (`IExportGraphMainView` or `IGraphMainView`) from `DTS.Common.Interface`.
---
## 4. Dependencies
### This module depends on:
- `System.Windows.Input` — Provides `CommandBinding` and `ApplicationCommands`
- `DTS.Common.Interface` — Provides `IExportGraphMainView` and `IGraphMainView` interfaces
### What depends on this module:
- **Not determinable from source alone.** The views are likely instantiated by a view factory, dependency injection container, or referenced by view models in the `DTS.Viewer.GraphList` module or a higher-level orchestration layer.
---
## 5. Gotchas
1. **No-op Undo Handlers:** Both views register command bindings for `ApplicationCommands.Undo` that do nothing except mark the event as handled. This effectively disables undo functionality without providing alternative behavior. The intent is unclear from source alone—this may be intentional suppression or placeholder code.
2. **Commented-Out Code in `GraphMainView`:** The presence of commented-out references to `root.IsChecked`, `TvTestChannels.Focus()`, and the `SetTvFocus()` method suggests incomplete or removed functionality. The original purpose of these members cannot be determined from source alone.
3. **Namespace Suppression:** Both files include `// ReSharper disable CheckNamespace`, indicating the namespace `DTS.Viewer.GraphList` may not match the folder structure (`DTS.Viewer.Modules/DTS.Viewer.GraphList/View/`). This could cause confusion when navigating the codebase.