Files

61 lines
5.0 KiB
Markdown
Raw Permalink Normal View History

2026-04-17 14:55:32 -04:00
---
source_files:
- Common/DTS.CommonCore/Events/DTS.Viewer/ViewerSettings/CalibrationBehaviorSettableInViewerChangedEvent.cs
- Common/DTS.CommonCore/Events/DTS.Viewer/ViewerSettings/ViewerSettingsVisibilityChangedEvent.cs
generated_at: "2026-04-16T02:49:52.617936+00:00"
model: "Qwen/Qwen3-Coder-Next-FP8"
schema_version: 1
sha256: "7819516e9af4aa9e"
---
# ViewerSettings
### 1. **Purpose**
This module defines two Prism-based event types used for broadcasting changes to viewer settings within the DTS application. Specifically, `CalibrationBehaviorSettableInViewerChangedEvent` signals when the availability (enabled/disabled state) of calibration behavior configuration in the viewer has changed, while `ViewerSettingsVisibilityChangedEvent` signals when the visibility state of the viewer settings panel has changed. These events facilitate loose coupling between components that manage or respond to viewer configuration state, enabling reactive UI updates or logic adjustments without direct dependencies.
---
### 2. **Public Interface**
- **`CalibrationBehaviorSettableInViewerChangedEvent`**
- **Inherits from**: `CompositePresentationEvent<bool>`
- **Behavior**: A Prism event used to publish and subscribe to changes in whether calibration behavior settings are settable (i.e., enabled) in the viewer. The payload is a `bool`: `true` indicates calibration behavior *is* settable; `false` indicates it is not.
- **Usage**: Published when the underlying logic determines that the user should or should not be allowed to modify calibration behavior via the viewer UI (e.g., due to permissions, mode constraints, or data state).
- **`ViewerSettingsVisibilityChangedEvent`**
- **Inherits from**: `CompositePresentationEvent<Visibility>`
- **Behavior**: A Prism event used to publish and subscribe to changes in the visibility of the viewer settings panel. The payload is a `System.Windows.Visibility` value (`Visible`, `Collapsed`, or `Hidden`).
- **Usage**: Published when the viewer settings panel is shown, hidden, or collapsed—e.g., in response to user actions (toggling a settings button) or application state changes (e.g., entering full-screen mode).
---
### 3. **Invariants**
- Both events are *purely informational*—they carry no side effects beyond notification; subscribers are responsible for any state changes or UI updates.
- The payload for `CalibrationBehaviorSettableInViewerChangedEvent` is strictly a `bool`, with no defined semantics beyond “settable” (`true`) vs. “not settable” (`false`). No intermediate or invalid states are implied.
- The payload for `ViewerSettingsVisibilityChangedEvent` must be one of the three `Visibility` enum values defined in `System.Windows`, and no other values are expected.
- Events are published *asynchronously* (via Prisms `CompositePresentationEvent` semantics), so subscribers may not receive events in the same call stack as the publisher.
- No ordering guarantees are provided between these two events—e.g., a visibility change may occur before or after a settable-state change, and subscribers must handle arbitrary sequences.
---
### 4. **Dependencies**
- **External Dependencies**:
- `Microsoft.Practices.Prism.Events` (Prism library for event aggregation).
- `System.Windows` (for `Visibility` type used in `ViewerSettingsVisibilityChangedEvent`).
- **Namespace**:
- Defined in `DTS.Common.Events`, indicating it is part of a shared/common core library (`DTS.CommonCore`).
- **Inferred Usage**:
- Likely consumed by viewer-related UI components (e.g., a settings panel view model or control) and possibly by core logic modules that manage calibration or viewer state.
- No direct reverse dependencies are visible in the source—these are leaf event definitions.
---
### 5. **Gotchas**
- **No default value semantics**: The source does not specify what the *initial* value of `CalibrationBehaviorSettableInViewerChangedEvent` or `ViewerSettingsVisibilityChangedEvent` should be (e.g., whether `false` or `Visibility.Collapsed` is the default). Subscribers must not assume an initial state unless documented elsewhere.
- **`Visibility` ambiguity**: `Visibility` has three states (`Visible`, `Collapsed`, `Hidden`), but the source does not clarify whether all three are intentionally used or whether only `Visible`/`Collapsed` are expected. Misuse (e.g., publishing `Hidden` when only `Collapsed` is handled) could cause subtle UI inconsistencies.
- **No deprecation or versioning markers**: The events lack attributes or comments indicating planned obsolescence, migration paths, or versioning—though this may be handled at a higher architectural layer.
- **Namespace consistency**: The `// ReSharper disable CheckNamespace` directive suggests the namespace is intentionally `DTS.Common.Events` (not nested under `DTS.CommonCore.Events`), which may conflict with folder structure expectations. Developers should verify expected namespace usage.
- **None identified from source alone.**