11 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T15:44:47.349944+00:00 | zai-org/GLM-5-FP8 | 1 | d26160d5c15903dc |
DataPRO UI Infrastructure Documentation
1. Purpose
This module provides the core WPF user interface infrastructure for the DataPRO application. It establishes the main application window, session lifecycle management via Prism/Unity, and a composite navigation system. The code defines contracts for page content (IPageContent), action handling (IActionButtonContainer), and supplies reusable controls for navigation steps, search functionality, licensing status display, and window customization.
2. Public Interface
Interfaces
IActionButtonContainer
Defines a contract for components that host and respond to action controls.
ActionButton[] GetActionButtons(): Returns an array ofControls.ActionButtoninstances.void OnActionButtonPress(Controls.ActionButton button): Handler for button click events.void OnActionComboBoxChange(Controls.ActionComboBox comboBox): Handler for combo box selection changes.void OnActionComboBoxDropDownClose(Controls.ActionComboBox comboBox): Handler for combo box drop-down closure.void OnActionRadioButtonPress(Controls.ActionRadioButton button): Handler for radio button clicks.
IPageContent
Defines the lifecycle and interaction contract for content displayed within the navigation system.
void StartSearch(string term): Initiates a search within the content.bool Validate(ref List<string> errors, ref List<string> warnings, bool displayWindow): Validates content state; returnstrueif valid.void OnSetActive(): Called when the content becomes active/visible.void SetPermissions(User.UserPermissionLevels actualPermission, User.UserPermissionLevels requiredPermission): Configures UI based on user rights.void UnSet(Action OnComplete = null): Cleans up resources when content is unloaded.bool OnButtonPress(Controls.PageButton button): Handles page-specific button presses.object GetPageContent(): Retrieves the content object.bool KeyDown(object sender, KeyEventArgs e): Handles keyboard input.
Classes
DataProMainWindow : Window
The application's main entry point window.
DataProMainWindow(): Constructor that initializes components and setscontentControl.Contentto a newLoginControl2.
DataProSession
Manages the application session, bootstrapping, and dependency injection container.
IUnityContainer Container { get; }: The Unity dependency container.IEventAggregator EventAggregator { get; }: Prism event aggregator instance.IRegionManager RegionManager { get; }: Prism region manager instance.void CreateSession(): Initializes the session with default configuration.void CreateSession(string customConfigPath): Initializes the session with a specific configuration path.void Terminate(): Called during application shutdown.
WaitCursor : IDisposable
A utility to temporarily set the mouse cursor to Cursors.Wait.
WaitCursor(): Constructor that saves the current cursor and setsMouse.OverrideCursortoCursors.Wait.void Dispose(): RestoresMouse.OverrideCursorto the previous value.
BoolToOppositeBoolConverter : IValueConverter
WPF value converter that inverts a boolean value.
object Convert(object value, Type targetType, object parameter, CultureInfo culture): Returns!(bool)value.object ConvertBack(...): ThrowsNotSupportedException.
TranslateExtension : MarkupExtension
XAML markup extension for localization.
TranslateExtension(string key): Constructor accepting the resource key.object ProvideValue(IServiceProvider serviceProvider): Returns the localized string fromStringResources.ResourceManager. Returns#stringnotfound#if the key is missing.
PageContentControl : UserControl, INotifyPropertyChanged
A composite control hosting navigation and main content areas.
object MainContent { get; set; }: The current main content; setting this triggersOnSetActive()onIPageContentimplementations.bool UsesNavControl { get; set; }: Toggles visibility of the navigation control.bool Validate(ref List<string> errors, ref List<string> warnings, bool displayWindow): Delegates validation to theNavControlorMainContent.void OnSetActive(): Activates the navigation control.void UnSet(): Cleans up the navigation control.
PageMainContentControl : UserControl, INotifyPropertyChanged
Hosts the actual content within a page.
object MainContent { get; set; }: The content to display.ContentControl GetContentControl(): Returns the internal content presenter.static void MarkInvalid(Control tb): Applies error styling (red border, specific styles) to a control.static void MarkValid(Control tb): Resets styling for a control.static void MarkWarning(Control tb): Applies warning styling (orange border) to a control.
PageSearchControl : UserControl, INotifyPropertyChanged
Provides search UI with debouncing.
bool UsesSearchControl { get; set; }: Toggles search box visibility.int RaiseSearchDelay { get; set; }: Delay in milliseconds before firing the search event.event SearchDelegate OnSearch: Event raised when a search executes.void ClearSearchTerm(): Clears the search text box.
NavGraphStep : UserControl, INotifyPropertyChanged
Represents a single step in a visual navigation graph.
string Title { get; }: The display text for the step.IPageContent NavStepContent { get; set; }: The content associated with this step.void SetStatus(StatusTypes status): Updates visual state (Current,NotCurrent).
WindowResizer
Helper class to enable borderless window resizing via Win32 API.
WindowResizer(Window activeW): Attaches to a window and hooksWndProc.void resizeWindow(object sender): Initiates resize based on the clicked rectangle name (e.g., "top", "bottomLeft").void displayResizeCursor(object sender): Updates the cursor to a resize icon based on position.void resetCursor(): Resets cursor toCursors.Arrow.void dragWindow(): Initiates a window drag operation.
LicensingFooter : UserControl, INotifyPropertyChanged
Displays licensing information at the bottom of the UI.
void OnSetActive(): Updates licensing state and messages.string LicensedTo,string LicenseType,string DataProVersion,string FooterMessage: Bindable properties for display.
PageNavControlsGroup : UserControl, INotifyPropertyChanged, IUIItems
A container for navigation controls, handling permissions and layout.
string UniqueId { get; set; }: Identifier for the control.int SetControls(UserControl[] controls, int startingRow): Populates the internal grid with controls.void SetEnabled(bool bEnable): Sets enabled state based on permissions.void SetVisible(bool bShow): Sets visibility based on user preferences/permissions.
PageActionControlsRibbon : UserControl
A ribbon-style container for action controls.
void SetGroups(PageActionControlsGroup[] groups): Populates the ribbon with groups.ActionButton GetButton(string id): Retrieves a button by ID.ActionComboBox GetComboBox(string id): Retrieves a combo box by ID.
PageActionButtonsRibbon : UserControl
A specific ribbon implementation for button groups.
void SetGroups(PageActionButtonsGroup[] groups): Populates the ribbon.- Routed Events:
FirstGroupFirstButtonClickedEvent,FirstGroupSecondButtonClickedEvent, etc.
3. Invariants
- Cursor Restoration:
WaitCursormust be disposed to restoreMouse.OverrideCursor. It is designed to be used within ausingblock. - Converter Target Type:
BoolToOppositeBoolConverter.ConvertrequirestargetTypeto bebool; otherwise, it throwsInvalidOperationException. - Session Initialization:
DataProSession.CreateSessionmust be called before accessingContainer,EventAggregator, orRegionManager. - Main Content Activation: Setting
PageContentControl.MainContentautomatically callsOnSetActive()on the new content if it implementsIPageContent, provided the applicationMainWindowis not null. - Re-entrancy Guard:
PageContentControl.MainContentsetter will return immediately without action if_bSettingMainContentActiveistrue. - Search Delay Coercion:
PageSearchControl.RaiseSearchDelaycoerces negative values to0.
4. Dependencies
Internal Dependencies (Inferred)
DataPROWin7.Controls: Custom controls (ActionButton,ActionComboBox,NavStep,PageButton, etc.).DataPROWin7.Properties: Application settings and resources.LoginControl2: Used inDataProMainWindow(definition not provided).DataProBootstrapper: Used inDataProSession(definition not provided).
External Dependencies
- Prism & Unity:
Prism.Events,Prism.Regions,Prism.Ioc,Prism.Unity,Unityfor DI and modular architecture. - WPF:
System.Windows,System.Windows.Controls,System.Windows.Input,System.Windows.Markup. - DTS Libraries:
DTS.Slice.Users(User permissions),DTS.Common.SharedResource.Strings(Localization),DTS.Common(Brushes/Colors). - ComponentOne:
C1.WPF(specificallyC1NumericBox). - Win32 API:
user32.dllforWindowResizer.
5. Gotchas
- Dead Code: The file
PageActionButtonsGroup.xaml.cscontains a class definition that is entirely commented out. It should not be considered functional. - Namespace Anomaly:
WindowResizer.csis defined in the global namespace (it lacks anamespacedeclaration), which is unusual for this codebase. - Event Naming Mismatch: In
PageActionButtonsRibbon, theSecondGroupThirdButtonClickedEventis registered with the name"ThirdGroupThirdButtonClickedEvent". This typo could cause issues if wiring events by name. - Hardcoded Strings in WindowResizer: The
resizeWindowanddisplayResizeCursormethods rely onswitchstatements matching theNameproperty of the sender (e.g., "top", "bottomRight"). These names must exactly match the XAML element names. - Localization Fallback:
TranslateExtensionreturns the string"#stringnotfound#"(appended with the key) rather than throwing an exception or returningnullif a resource key is missing. - Validation Styling:
PageMainContentControl.MarkInvalidandMarkValidrely on specific styles (PageContentTextBoxErrorStyle, etc.) being defined in the application resources. They also contain specific type checks for third-party controls (e.g.,C1NumericBox) and internal controls (ChannelCodeBuilder). - Memory Usage: Comments in
DataProSessionwarn that the bootstrapper loads ~40MB and cannot be cleanly unloaded once created.