7.2 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-16T02:57:21.705051+00:00 | Qwen/Qwen3-Coder-Next-FP8 | 1 | b0a99f13377fec7b |
Documentation: DTS.Common.Controls Auto-Generated WPF Control Files
1. Purpose
This directory contains auto-generated C# source files produced by the WPF build toolchain (PresentationBuildTasks) for several custom user controls and resources in the DTS.Common assembly. These files are not hand-written code but are generated at build time from corresponding .xaml files to implement the WPF IComponentConnector and IStyleConnector interfaces required for runtime XAML loading, event wiring, and field initialization. Their purpose is to enable the WPF runtime to correctly instantiate and connect UI elements defined in XAML to their code-behind classes (e.g., assigning x:Name-declared fields, attaching event handlers, and loading component resources). They do not contain business logic themselves but are essential infrastructure for the controls to function.
2. Public Interface
All classes are public partial and reside in the DTS.Common.Controls namespace. They implement System.Windows.Markup.IComponentConnector. None expose custom public methods or properties beyond standard WPF UserControl/Popup/ResourceDictionary behavior.
| Class | Base Type | Key Public Members |
|---|---|---|
RoundedBox |
System.Windows.Controls.UserControl |
void InitializeComponent() |
TestIDView |
System.Windows.Controls.UserControl |
void InitializeComponent() |
TestIdControl |
System.Windows.Controls.UserControl |
void InitializeComponent() |
CommonStatusRibbon |
System.Windows.Controls.UserControl |
void InitializeComponent(), internal fields: commonStatusRibbon, lblAggregateStatusText |
TestIDTextBox |
System.Windows.Controls.UserControl |
void InitializeComponent(), internal fields: TestIdTextBoxControl, tbTestId |
LookupPopup |
System.Windows.Controls.Primitives.Popup |
void InitializeComponent(), internal fields: lookupPopup, possibleChannels |
checkbox |
System.Windows.ResourceDictionary |
void InitializeComponent(), implements IStyleConnector |
GridViewColumnHeaderSearchable |
System.Windows.Controls.UserControl |
void InitializeComponent(), internal fields: dtsGridViewColumnHeader, mainGrid, TogglePopupButton, BtnArrow, ToggledPopup |
Note on IComponentConnector.Connect: This interface method is implemented explicitly and is not intended for direct use. It is called by the WPF runtime during component initialization to wire up named elements and event handlers. Its behavior is fully determined by the corresponding .xaml file.
3. Invariants
_contentLoadedflag: Each class maintains a privatebool _contentLoadedfield.InitializeComponent()is idempotent: it returns immediately if_contentLoadedis alreadytrue.- XAML resource URIs: All calls to
Application.LoadComponentuse relative URIs of the form/DTS.Common;component/controls/{filename}.xaml, where{filename}matches the control’s XAML file (case-insensitive, e.g.,roundedbox.xaml,testidview.xaml). - Connection ID mapping: The
Connect(int connectionId, object target)method usesconnectionIdvalues to identify which XAML-declared element or style setter is being wired. These IDs are stable per XAML file and generated by the build tool. - No side effects in
Connect: TheConnectmethod only assigns fields and adds event handlers; it does not mutate external state or perform validation beyond casting.
4. Dependencies
Internal Dependencies (from imports)
System.Windows.*(WPF core namespaces)Microsoft.Windows.Controls(likely from an external control library, e.g., Microsoft Toolkit or similar)DTS.Common.Strings(used only inLookupPopup.g.csandLookupPopup.g.i.cs)DTS.Common.Controls(self-referential for internal field assignments)
External Dependencies
System.dll,PresentationFramework.dll,WindowsBase.dll,PresentationCore.dll(standard WPF assemblies)Microsoft.Windows.Controls(external assembly referenced at build time)- XAML source files in
Controls/directory (e.g.,RoundedBox.xaml,LookupPopup.xaml)
What Depends on This Module?
- The corresponding partial classes in the codebase (e.g.,
RoundedBox.xaml.cs,LookupPopup.xaml.cs) depend on these generated files to initialize their UI and event handlers. - Any code that instantiates these controls (e.g.,
new RoundedBox()) implicitly relies onInitializeComponent()being called (typically via the constructor in the partial class).
5. Gotchas
- Auto-generated only: These files are not meant to be edited. Changes will be overwritten on rebuild. Custom logic must reside in the corresponding
.xaml.csfiles. - Case sensitivity: XAML filenames (e.g.,
roundedbox.xaml,testidview.xaml) are referenced in URIs with lowercase names, but class names (e.g.,RoundedBox,TestIDView) use PascalCase. Ensure XAML file names match exactly (case-sensitive on case-sensitive file systems). - Event handler naming: Event handlers (e.g.,
tbTestId_PreviewTextInput,LookupPopup_OnOpenedClosed) are referenced in generated code but are not defined in these files. They must be implemented in the corresponding.xaml.csfiles. - Field naming inconsistencies: Some controls use camelCase for internal fields (
commonStatusRibbon,lookupPopup,dtsGridViewColumnHeader), while others use PascalCase (TestIdInfo,TestIdTextBoxControl). This reflects naming conventions in the source XAML (x:Nameattributes). IStyleConnectorusage: Thecheckboxcontrol implementsIStyleConnector, meaning it wires event setters in styles (e.g.,ToolTipOpeninghandlers). This implies the XAML defines styles withx:Keyor implicit targeting, and handlers likeToolTipEventHandlermust exist in the code-behind.- Missing source files: The documentation cannot verify the actual behavior of controls (e.g.,
LookupPopup’sPossibleChannels_OnMouseDoubleClickhandler) because the corresponding.xamland.xaml.csfiles are not provided. Behavior is inferred only from event subscription in generated code.
None identified beyond the above.