5.6 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||||
|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:57:31.657940+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | 5aeec8a3a4ec19d3 |
Documentation: NotificationWindow and ConfirmationWindow Classes
1. Purpose
This module contains auto-generated WPF window classes used for displaying simple notification and confirmation dialogs within the DTS.Common.Dialogs namespace. NotificationWindow provides a modal dialog with a single OK button (and a hidden copy-to-clipboard button referenced in generated code), while ConfirmationWindow provides a modal dialog with OK and Cancel buttons for user confirmation flows. These classes are generated from corresponding XAML files (NotificationWindow.xaml and ConfirmationWindow.xaml) and serve as the code-behind for lightweight, standardized UI prompts in the application.
2. Public Interface
Both classes are partial and inherit from System.Windows.Window. They implement System.Windows.Markup.IComponentConnector to support WPF's XAML loading and event wiring.
NotificationWindow
-
public void InitializeComponent()
Initializes the window by loading its XAML definition from/DTS.Common;component/dialogs/notificationwindow.xaml. Ensures initialization occurs only once via_contentLoadedflag. -
void IComponentConnector.Connect(int connectionId, object target)(explicit interface implementation)
Connects XAML-declared UI elements to fields in the generated code-behind. Handles four connection IDs:1: Assignsthis.notificationWindow(self-reference).2: AssignsLayoutRoot(Grid).3: AttachesCoppyToClibord_Clickhandler to a button’sClickevent (note: method name appears misspelled — CoppyToClibord_Click).4: AssignsOKButton(Button).
ConfirmationWindow
-
public void InitializeComponent()
Initializes the window by loading its XAML definition from/DTS.Common;component/dialogs/confirmationwindow.xaml. Ensures initialization occurs only once via_contentLoadedflag. -
void IComponentConnector.Connect(int connectionId, object target)(explicit interface implementation)
Connects XAML-declared UI elements to fields in the generated code-behind. Handles four connection IDs:1: Assignsthis.confirmationWindow(self-reference).2: AssignsLayoutRoot(Grid).3: AssignsOKButton(Button).4: AssignsCancelButton(Button).
Note
: No custom logic (e.g., event handlers, properties, or methods beyond initialization) is defined in these generated files. All business logic must reside in the corresponding partial class definitions (e.g.,
NotificationWindow.xaml.cs), which are not provided here.
3. Invariants
_contentLoadedisfalsebefore first call toInitializeComponent()andtrueafterward; subsequent calls toInitializeComponent()are no-ops.- UI element fields (
LayoutRoot,OKButton,CancelButton,notificationWindow,confirmationWindow) are assigned exactly once duringConnect()based onconnectionId. NotificationWindowexpects a button (likelyOKButton) to have aClickevent handler namedCoppyToClibord_Clickdefined elsewhere (in the non-generated partial class).ConfirmationWindowdoes not wire any event handlers in the generated code — event wiring for OK/Cancel must be done in the partial class.
4. Dependencies
This module depends on:
System.Windows(WPF core)System.Windows.Markup(forIComponentConnector)System.Windows.Controls(forWindow,Grid,Button)Microsoft.Windows.Controls(likely Microsoft Expression SDK or similar)Microsoft.Xaml.Behaviors.*(various behavior namespaces — used in XAML, not directly in generated code)
This module is depended upon by:
- Other parts of
DTS.Common(e.g., code that instantiatesNotificationWindoworConfirmationWindow). - XAML files (
NotificationWindow.xaml,ConfirmationWindow.xaml) — the source from which this code is generated.
5. Gotchas
- Typo in event handler name: The generated code references
CoppyToClibord_Click(likely intended to beCopyToClipboard_Click). Ensure the corresponding partial class defines this handler, or the app will throw a runtimeMissingMethodExceptionwhen the button is clicked. - No public constructors or properties defined here: These classes are minimal and rely on the partial class (not provided) for constructor logic, content properties, or dialog behavior.
- Hardcoded resource URI:
InitializeComponent()uses a fixed pack URI (/DTS.Common;component/dialogs/notificationwindow.xaml). Moving or renaming the XAML file will break initialization. - No explicit dialog result handling: Unlike typical confirmation dialogs,
ConfirmationWindowdoes not setDialogResultin the generated code — this must be handled manually in the partial class (e.g., on OK/Cancel button clicks). - Auto-generated files: These files are regenerated on build; manual edits will be lost. Any custom logic must be placed in the corresponding
.xaml.cspartial class. - Missing event wiring for
ConfirmationWindow: WhileNotificationWindowwires aClickhandler inConnect(),ConfirmationWindowdoes not — OK/Cancel behavior must be wired explicitly in the partial class.
None identified beyond the above.