2.8 KiB
2.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
2026-04-17T16:07:35.691560+00:00 | zai-org/GLM-5-FP8 | 1 | 552d84b401685097 |
View
Purpose
This module provides base classes for WPF view components within the DTS framework. It establishes a consistent pattern for views to expose dirty-state tracking and header information by delegating to their DataContext ViewModels. Both BaseWindow and BaseView serve as abstracted base types that bridge the gap between standard WPF controls (Window, UserControl) and the application's ViewModel contracts (IBaseWindowModel, IBaseViewModel, IHeaderInfoProvider<string>).
Public Interface
BaseWindow : Window, IBaseWindow
bool IsDirty { get; }— Returnstrueif theDataContextimplementsIBaseWindowModeland itsIsDirtyproperty istrue. ReturnsfalseifDataContextis null or does not implement the interface.string HeaderInfo { get; }— Returns theHeaderInfofromDataContextif it implementsIHeaderInfoProvider<string>. Returnsstring.EmptyifDataContextis null or does not implement the interface.
BaseView : UserControl, IBaseView
bool IsDirty { get; }— Returnstrueif theDataContextimplementsIBaseViewModeland itsIsDirtyproperty istrue. ReturnsfalseifDataContextis null or does not implement the interface.string HeaderInfo { get; }— Returns theHeaderInfofromDataContextif it implementsIHeaderInfoProvider<string>. Returnsstring.EmptyifDataContextis null or does not implement the interface.
Invariants
IsDirtywill never throw; it safely returnsfalsewhenDataContextis null or incompatible.HeaderInfowill never throw; it safely returnsstring.EmptywhenDataContextis null or incompatible.- Both properties are read-only getters with no setters.
Dependencies
Depends on:
System.Windows(Window class)System.Windows.Controls(UserControl class)IBaseWindow,IBaseWindowModel,IBaseViewModel,IHeaderInfoProvider<string>(interfaces not shown in source; assumed defined elsewhere in DTS.CommonCore or related assemblies)
Depended on by:
- Unclear from source alone; likely all Window and UserControl derivatives in the DTS application.
Gotchas
- Interface mismatch between BaseWindow and BaseView:
BaseWindow.IsDirtychecks forIBaseWindowModel, whileBaseView.IsDirtychecks forIBaseViewModel. These are different interfaces. A ViewModel intended for use with both must implement both interfaces, or dirty state will report incorrectly in one context. - The namespace is declared as
DTS.Common.Basebut the file path suggestsDTS.CommonCore. This may indicate a historical namespace rename or intentional divergence.