5.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-17T15:37:50.866970+00:00 | zai-org/GLM-5-FP8 | 1 | 36f77dfe5ce8c20c |
Documentation: DTS.Common.Dialogs
1. Purpose
This module provides WPF dialog window components for user interaction within the DTS.Common library. It contains auto-generated partial classes for NotificationWindow and ConfirmationWindow, which serve as standard UI dialogs for displaying notifications and confirmation prompts respectively. These classes are generated by the WPF build process from XAML definitions and implement IComponentConnector to support XAML element naming and event binding.
2. Public Interface
NotificationWindow
Class: DTS.Common.Dialogs.NotificationWindow
Inheritance: System.Windows.Window, System.Windows.Markup.IComponentConnector
| Member | Signature | Description |
|---|---|---|
InitializeComponent() |
public void InitializeComponent() |
Loads the XAML component from /DTS.Common;component/dialogs/notificationwindow.xaml. Idempotent—returns early if already called. |
Connect(int, object) |
void IComponentConnector.Connect(int connectionId, object target) |
Internal method that wires named XAML elements to their code-behind fields and attaches event handlers. Not intended for direct use. |
Internal Fields (XAML-named elements):
notificationWindow— Self-reference to the window instance (line 7 of XAML)LayoutRoot—System.Windows.Controls.Gridcontainer (line 45 of XAML)OKButton—System.Windows.Controls.Buttonfor dismissal (line 63 of XAML)
Event Handler (referenced):
CoppyToClibord_Click—System.Windows.RoutedEventHandlerattached to an unnamed button'sClickevent (line 62 of XAML). Note: Implementation resides in the non-generated code-behind file (not provided).
ConfirmationWindow
Class: DTS.Common.Dialogs.ConfirmationWindow
Inheritance: System.Windows.Window, System.Windows.Markup.IComponentConnector
| Member | Signature | Description |
|---|---|---|
InitializeComponent() |
public void InitializeComponent() |
Loads the XAML component from /DTS.Common;component/dialogs/confirmationwindow.xaml. Idempotent—returns early if already called. |
Connect(int, object) |
void IComponentConnector.Connect(int connectionId, object target) |
Internal method that wires named XAML elements to their code-behind fields. Not intended for direct use. |
Internal Fields (XAML-named elements):
confirmationWindow— Self-reference to the window instance (line 6 of XAML)LayoutRoot—System.Windows.Controls.Gridcontainer (line 27 of XAML)OKButton—System.Windows.Controls.Buttonfor confirmation (line 45 of XAML)CancelButton—System.Windows.Controls.Buttonfor cancellation (line 53 of XAML)
3. Invariants
- Single Initialization:
InitializeComponent()must only be called once per instance. Subsequent calls return immediately without reloading the XAML. - Partial Class Requirement: Both
NotificationWindowandConfirmationWindowarepartialclasses. The actual business logic, event handler implementations, and additional members must be defined in companion code-behind files (e.g.,NotificationWindow.xaml.cs). - XAML Resource Availability: The XAML resources at
/DTS.Common;component/dialogs/notificationwindow.xamland/DTS.Common;component/dialogs/confirmationwindow.xamlmust be embedded in the assembly forApplication.LoadComponentto succeed. - Connection IDs: The
Connectmethod uses hardcodedconnectionIdvalues (1–4). These must remain synchronized with the XAML compilation output.
4. Dependencies
This module depends on:
System.Windows(WPF core)System.Windows.ControlsSystem.Windows.Markup(IComponentConnector)Microsoft.Xaml.Behaviors(behavior libraries referenced in imports)Microsoft.Windows.Controls(extended controls)PresentationBuildTasks(code generation, runtime version 4.0.30319.42000)
Consumers:
- Unknown from source alone. These dialogs are likely consumed by other modules within the DTS system that require user notification or confirmation.
5. Gotchas
-
Typo in Event Handler Name: The event handler
CoppyToClibord_Clickcontains spelling errors ("Coppy" instead of "Copy", "Clibord" instead of "Clipboard"). This typo exists in the XAML and propagates to the generated code. The actual implementation method in the code-behind must match this exact spelling. -
Auto-Generated Files: The provided source files (
.g.csand.g.i.cs) are auto-generated and should not be manually edited. Any changes will be overwritten on recompilation. Modifications must be made in the corresponding.xamland.xaml.csfiles. -
Missing Code-Behind: The actual implementations of
CoppyToClibord_Clickand any additional logic are not present in these generated files. The behavior of these dialogs cannot be fully understood without the companion.xaml.csfiles. -
Duplicate Files: Both
.g.csand.g.i.csvariants are provided for each window. These are functionally identical in content; the.g.i.csvariant is used for IntelliSense during design-time, while.g.csis used at compile-time.