6.1 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||
|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T11:22:34.808193+00:00 | zai-org/GLM-5-FP8 | 1 | e704fa30e232a4ba |
Documentation: DTS.Viewer Classes
1. Purpose
This module provides a collection of UI support classes for the DTS Viewer WPF application. It includes data binding helpers (BindingProxy), custom controls (ComponentsGroupControl), and placeholder model classes (MenuItem, TabItem, NavigationItem) that appear to support the application's navigation and presentation layer. The module exists to enable XAML-specific features like data binding in non-visual contexts and to provide reusable UI components.
2. Public Interface
DTS.Viewer.BindingProxy
A Freezable-derived class that enables data binding in contexts where the DataContext is not naturally inherited (e.g., from within a Style or DataTrigger).
| Member | Signature | Description |
|---|---|---|
DataProperty |
public static readonly DependencyProperty |
Dependency property backing store for Data. Registered with name "Data", type object, owner type BindingProxy. |
Data |
public object Data { get; set; } |
Gets or sets an arbitrary data object for binding purposes. Uses GetValue/SetValue on DataProperty. |
CreateInstanceCore |
protected override Freezable CreateInstanceCore() |
Required override for Freezable. Returns a new instance of BindingProxy. |
DTS.Viewer.ComponentsGroupControl
A custom Control for displaying a grouped component with an image and title.
| Member | Signature | Description |
|---|---|---|
ClickEventArgs |
public class ClickEventArgs : EventArgs |
Nested class for click event arguments. Contains only a default constructor. |
ClickCommand |
public static RoutedCommand ClickCommand { get; } |
Static routed command named "ClickCommand". Returns the private _click field. |
ImageProperty |
public static readonly DependencyProperty ImageProperty |
Dependency property for the Image property. Type ImageSource, default value null. |
Image |
public ImageSource Image { get; set; } |
Gets or sets the image source displayed by the control. |
TitleProperty |
public static readonly DependencyProperty TitleProperty |
Dependency property for the Title property. Type string, default value "Title". |
Title |
public string Title { get; set; } |
Gets or sets the title text displayed by the control. |
Private/Static Members:
private static RoutedCommand _click— Backing field forClickCommand.private static void OnCommandExecute(object sender, ExecutedRoutedEventArgs e)— Command handler; casts sender toComponentsGroupControlbut performs no further action.private static void InitializeCommands()— Registers theClickCommandwithCommandManager.static ComponentsGroupControl()— Static constructor that overridesDefaultStyleKeyPropertymetadata and initializes commands.
DTS.Viewer.MenuItem
An empty internal class with no members. Purpose unclear from source alone.
DTS.Viewer.Classes.TabItem
An empty internal class with no members. Purpose unclear from source alone.
DTS.Viewer.Classes.NavigationItem
An empty public class with no members. Purpose unclear from source alone.
3. Invariants
- BindingProxy: As a
Freezablesubclass,CreateInstanceCore()must always return a new instance ofBindingProxy(currently satisfied). - ComponentsGroupControl:
- The static constructor always runs before any instance is created, ensuring
DefaultStyleKeyPropertymetadata is overridden and commands are registered. Titleproperty defaults to the string"Title"(viaUIPropertyMetadata).Imageproperty defaults tonull.
- The static constructor always runs before any instance is created, ensuring
- Dependency Properties: All dependency properties follow WPF conventions—registered with correct owner types and accessed via
GetValue/SetValue.
4. Dependencies
Imports (What this module depends on):
| Class | Dependencies |
|---|---|
BindingProxy |
System.Windows (Freezable, DependencyProperty) |
ComponentsGroupControl |
System, System.Windows, System.Windows.Controls, System.Windows.Input, System.Windows.Media |
MenuItem, TabItem, NavigationItem |
None (no imports) |
Dependents (What depends on this module):
Cannot be determined from source alone. These classes are likely referenced by XAML files, view models, or other code files not provided in this source set.
5. Gotchas
-
ComponentsGroupControl.OnCommandExecutedoes nothing useful: The method casts the sender toComponentsGroupControlbut performs no action afterward. The actual click handling logic is either missing or expected to be implemented elsewhere (possibly in XAML or a code-behind not shown). -
Commented-out code in
ComponentsGroupControl: Several members are commented out:SubtitlePropertyandSubtitlepropertyTabItemPropertyandTabItemproperty (referencing a typeDataModel.TabPageItem)ClickEventHandlerdelegate andOnClickedevent
This suggests incomplete refactoring or features that were started but not finished.
-
Empty placeholder classes:
MenuItem,TabItem, andNavigationItemhave no members whatsoever. They may be stubs awaiting implementation, used only as markers in XAML, or remnants of abandoned development. -
Namespace inconsistency:
MenuItemis inDTS.Viewernamespace, whileTabItemandNavigationItemare inDTS.Viewer.Classes. This inconsistency may cause confusion when locating classes. -
ClickEventArgsis defined but never used: The nestedClickEventArgsclass exists inComponentsGroupControl, but the associated event (OnClicked) is commented out, making this class currently unused.