4.2 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-16T12:22:53.517734+00:00 | zai-org/GLM-5-FP8 | 1 | aacb0b18894c95e6 |
Documentation: IViewerSettingsView & IViewerSettingsViewModel
1. Purpose
This module defines the contract for a Viewer Settings UI component following the MVVM (Model-View-ViewModel) pattern. IViewerSettingsView represents the view abstraction, while IViewerSettingsViewModel defines the presentation logic and state for configuring viewer-related settings, specifically calibration behavior options. These interfaces enable decoupled communication between the UI layer and business logic, allowing for testability and separation of concerns within the DTS viewer settings subsystem.
2. Public Interface
IViewerSettingsView
Namespace: DTS.Common.Interface
public interface IViewerSettingsView : IBaseView { }
A marker interface extending IBaseView with no additional members. Serves as a type contract for viewer settings views.
IViewerSettingsViewModel
Namespace: DTS.Common.Interface
public interface IViewerSettingsViewModel : IBaseViewModel
| Member | Type | Access | Description |
|---|---|---|---|
View |
IViewerSettingsView |
get/set | Reference to the associated view instance. |
Parent |
IBaseViewModel |
get/set | Reference to the parent view model in the hierarchy. |
PublishChanges() |
void |
method | Publishes/commits current settings changes. Implementation behavior not specified in source. |
CalibrationBehaviorSettingVisibility |
Visibility |
get/set | Controls visibility of the calibration behavior setting UI element. |
OverallSettingsVisibility |
Visibility |
get | Read-only visibility state for overall settings panel. |
AvailableCalibrationBehaviors |
DisplayedCalibrationBehavior[] |
get | Array of available calibration behavior options for selection. |
CalibrationBehaviorSetting |
DisplayedCalibrationBehavior |
get/set | Currently selected calibration behavior setting. |
3. Invariants
IViewerSettingsViewmust always be assignable toIBaseView(inheritance constraint).IViewerSettingsViewModelmust always be assignable toIBaseViewModel(inheritance constraint).AvailableCalibrationBehaviorsis read-only; consumers cannot replace the array reference, though the source does not specify whether the array contents are mutable.OverallSettingsVisibilityis read-only; its value is determined internally by the implementing class.
Unclear from source:
- Whether
ViewandParentmust be non-null at any point in the lifecycle. - Whether
PublishChanges()validates state before publishing or throws on invalid state. - The relationship between
CalibrationBehaviorSettingVisibilityandOverallSettingsVisibility.
4. Dependencies
This module depends on:
DTS.Common.Base— forIBaseViewandIBaseViewModelbase interfacesDTS.Common.Classes.Sensors— forDisplayedCalibrationBehaviortypeSystem.Windows— forVisibilityenumeration (WPF-specific)
What depends on this module:
Cannot be determined from source alone. No consumers are shown in the provided files.
5. Gotchas
- WPF Coupling: The use of
System.Windows.Visibilityties this interface to WPF. Porting to other UI frameworks would require abstraction changes. - Mutable Array Exposure:
AvailableCalibrationBehaviorsreturns an array (DisplayedCalibrationBehavior[]), not an immutable collection. If the implementing class does not defensively copy, callers could potentially modify array contents. - Setter on View Property: The
Viewproperty has a public setter, which may indicate the view can be swapped at runtime. Thread-safety implications are unclear from source. - PublishChanges Semantics: The method name suggests a publish/subscribe or event-sourcing pattern, but the actual behavior (synchronous vs. asynchronous, error handling, side effects) is not specified in the interface.