init
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
---
|
||||
source_files:
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/View/PSDReportMainView.xaml.cs
|
||||
- DTS Viewer/DTS.Viewer.Reports/DTS.Viewer.PSDReport/View/PSDReportMainViewGrid.xaml.cs
|
||||
generated_at: "2026-04-17T16:11:57.315846+00:00"
|
||||
model: "zai-org/GLM-5-FP8"
|
||||
schema_version: 1
|
||||
sha256: "a6e4756ad90b5059"
|
||||
---
|
||||
|
||||
# View
|
||||
|
||||
### Purpose
|
||||
This module provides WPF view components for the PSD (Power Spectral Density) Report feature. It contains two partial classes that serve as code-behind for XAML views, handling view initialization and UI event coordination. The module acts as the presentation layer for PSD report visualization, managing tab focus and responding to graph loading events.
|
||||
|
||||
### Public Interface
|
||||
|
||||
**PSDReportMainView** (implements `IPSDReportMainView`)
|
||||
- `PSDReportMainView()` - Default constructor that calls `InitializeComponent()`. Contains commented-out code for AvalonDock layout serialization/deserialization via `XmlLayoutSerializer`.
|
||||
|
||||
**PSDReportMainViewGrid** (implements `IPSDReportMainViewGrid`)
|
||||
- `PSDReportMainViewGrid()` - Constructor that calls `InitializeComponent()` and registers a `Loaded` event handler.
|
||||
- `PSDReportMainViewGrid_Loaded(object sender, RoutedEventArgs e)` - Private event handler that resolves `IEventAggregator` from `ContainerLocator.Container` and subscribes to `GraphLoadedCountNotification` event.
|
||||
- `OnGraphLoadedCountNotification(GraphLoadedCountNotificationArg arg)` - Private callback that validates the `DataContext` matches `arg.ParentVM`, then spawns a background task that waits 3 seconds before setting focus to `chartResultsTab` via `Dispatcher.BeginInvoke`.
|
||||
- `SetFocus()` - Private method that selects, makes focusable, and focuses `chartResultsTab`.
|
||||
|
||||
### Invariants
|
||||
- `PSDReportMainViewGrid._eventAggregator` is null until the `Loaded` event fires.
|
||||
- `OnGraphLoadedCountNotification` will early-return if `DataContext` is null or does not match `arg.ParentVM` (cast to `IBaseViewModel`).
|
||||
- The 3-second delay in `OnGraphLoadedCountNotification` is hardcoded and unconditional when the callback proceeds.
|
||||
|
||||
### Dependencies
|
||||
**Depends on:**
|
||||
- `DTS.Common.Interface` (`IPSDReportMainView`, `IPSDReportMainViewGrid`, `IBaseViewModel`)
|
||||
- `DTS.Common.Base` (referenced but usage unclear from source)
|
||||
- `DTS.Common.Events` (`GraphLoadedCountNotification`, `GraphLoadedCountNotificationArg`)
|
||||
- `Prism.Ioc` (`ContainerLocator`)
|
||||
- `Prism.Events` (`IEventAggregator`)
|
||||
|
||||
**Depended on by:** Not determinable from source alone.
|
||||
|
||||
### Gotchas
|
||||
- **FB 14797 reference:** The code comments reference a bug/feature request number, indicating the event subscription pattern was added to fix a timing issue with `IEventAggregator` availability.
|
||||
- **Hardcoded 3-second delay:** The `Thread.Sleep(TimeSpan.FromSeconds(3))` is a magic number with no configuration. This may be insufficient on slower systems or unnecessarily long on faster ones.
|
||||
- **Commented-out AvalonDock code:** `PSDReportMainView` contains significant commented-out code for dock layout persistence. It's unclear if this functionality was removed intentionally or is work-in-progress.
|
||||
- **Namespace suppression:** Multiple ReSharper disable comments suggest the namespace may not match the folder structure convention.
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user