8.1 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
2026-04-17T15:34:12.771311+00:00 | zai-org/GLM-5-FP8 | 1 | 9007c4cfc646753a |
Documentation: DTS.Common.Dialogs
1. Purpose
This module provides a WPF dialog infrastructure built on Prism's InteractionRequest pattern. It enables the display of modal and non-modal popup windows (confirmations and notifications) through trigger actions, supports region management within dialogs, and provides a Win32 wrapper for native folder selection dialogs. The module bridges Prism's MVVM-friendly interaction requests with custom WPF window implementations.
2. Public Interface
Interfaces
IRegionManagerAware
Enables objects to receive a scoped IRegionManager instance.
IRegionManager RegionManager { get; set; }
IPopupWindowActionAware
Enables objects to receive host window and notification context.
Window HostWindow { get; set; }
Notification HostNotification { get; set; }
Classes
ConfirmationEx : Confirmation
Extended confirmation with configurable buttons and imagery.
| Property | Type | Default |
|---|---|---|
Buttons |
MessageBoxButton |
MessageBoxButton.OKCancel |
Image |
MessageBoxImage |
MessageBoxImage.Question |
Result |
MessageBoxResult |
(unset) |
ConfirmationWindow
WPF window for displaying confirmations. Removes the system close button via Win32 API.
| Member | Type | Description |
|---|---|---|
ConfirmationTemplateProperty |
DependencyProperty |
Registered for DataTemplate |
ConfirmationTemplate |
DataTemplate |
Template for confirmation content |
Connect(int, object) |
void |
Throws NotImplementedException |
NotificationWindow : Window
WPF window for displaying notifications. Removes the system close button via Win32 API.
| Member | Type | Description |
|---|---|---|
NotificationTemplateProperty |
DependencyProperty |
Registered for DataTemplate |
NotificationTemplate |
DataTemplate |
Template for notification content |
ImageUriProperty |
DependencyProperty |
Registered for Uri |
ImageUri |
Uri |
URI for notification image |
Connect(int, object) |
void |
Empty implementation |
CoppyToClibord_Click(object, RoutedEventArgs) |
void |
Sets clipboard to hardcoded string |
PopupWindowAction : TriggerAction<FrameworkElement>
Trigger action that displays popup windows in response to InteractionRequestedEventArgs.
Nested Enum:
public enum WindowPositions { CenterOwner, CenterScreen }
Dependency Properties:
| Property | Type | Default |
|---|---|---|
WindowContent |
FrameworkElement |
null |
ContentTemplate |
DataTemplate |
null |
IsModal |
bool |
null (effectively false) |
StartupPosition |
WindowPositions |
CenterScreen |
CenterOverAssociatedObject |
bool |
null (legacy, unused) |
AllowMultipleNotificationWindows |
bool |
null (effectively false) |
Protected Methods:
Invoke(object parameter)— Main entry point; creates and displays the window.PrepareContentForWindow(Notification, Window)— Wires upIRegionManagerAwareandIPopupWindowActionAwareon content and its DataContext.GetWindow(Notification)— Returns either a generic window withWindowContentor a specialized window viaCreateWindow.CreateWindow(Notification)— CreatesConfirmationWindoworNotificationWindowbased on notification type.GetImageUri(PopupWindowImage)— Maps enum to pack URI for images.
BrowseForFolderDialog
Win32 SHBrowseForFolder wrapper for folder selection.
Properties:
| Property | Type | Description |
|---|---|---|
SelectedFolder |
string |
Final selected path (read-only after dialog) |
Title |
string |
Dialog header text |
InitialFolder |
string |
Pre-selected folder path |
InitialExpandedFolder |
string |
Pre-selected and expanded folder (overrides InitialFolder) |
OKButtonText |
string |
Custom OK button text |
BrowseInfo |
BROWSEINFOW |
Direct access to Win32 structure |
BrowserDialogFlags |
BrowseInfoFlags |
Flags for dialog behavior |
Methods:
ShowDialog()→Nullable<bool>— Shows dialog without owner.ShowDialog(Window owner)→Nullable<bool>— Shows dialog with WPF window owner.
Nested Types:
BrowseCallbackProc— Delegate for browse event handling.BrowseInfoFlags— Flags enum (BIF_NEWDIALOGSTYLE,BIF_RETURNONLYFSDIRS, etc.).BROWSEINFOW— Win32 structure withhwndOwner,pidlRoot,pszDisplayName,lpszTitle,ulFlags,lpfn,lParam,iImage.MessageFromBrowser— Messages received from dialog (BFFM_INITIALIZED,BFFM_SELCHANGED, etc.).MessageToBrowser— Messages sent to dialog (BFFM_SETSELECTIONW,BFFM_SETEXPANDED,BFFM_SETOKTEXT, etc.).
3. Invariants
-
Window close button removal: Both
ConfirmationWindowandNotificationWindowalways strip theWS_SYSMENUstyle duringSourceInitialized, removing the system close button. -
WindowContent parent check:
PopupWindowAction.Invokereturns immediately without action ifWindowContent.Parent != null. -
Notification type requirement:
PopupWindowAction.CreateWindowreturnsnullif the notification is not aConfirmationandnotification.Contentis not castable toNotificationContentEventArgs. -
Default browse flags:
BrowseForFolderDialogalways initializes withBIF_NEWDIALOGSTYLE. -
Scoped RegionManager: If
WindowContentlacks aRegionManager,PopupWindowActioncreates a new scopedRegionManagerand assigns it.
4. Dependencies
External Dependencies (from imports):
Microsoft.Practices.Prism.Regions—IRegionManager,RegionManagerMicrosoft.Practices.Prism.Interactivity.InteractionRequest—Notification,Confirmation,InteractionRequestedEventArgsSystem.Windows.Interactivity—TriggerAction<T>System.Windows— WPF core types
Internal Dependencies (inferred):
DTS.Common.Enums.PopupWindowImage— Enum for notification image typesDTS.Common.Events.NotificationContentEventArgs— Content type for notifications
Native Dependencies:
user32.dll—SetWindowLong,GetWindowLong,SendMessageWshell32.dll—SHBrowseForFolderW,SHGetPathFromIDList
5. Gotchas
-
ConfirmationWindow.Connectthrows: TheConnectmethod is implemented but throwsNotImplementedException. Purpose is unclear from source—may be related to XAML compilation or an interface requirement. -
Hardcoded clipboard text:
NotificationWindow.CoppyToClibord_Click(note typo in method name) sets clipboard to the literal string"Hello, clipboard". This appears to be debug/test code left in production. -
Commented-out timeout functionality: Both
ConfirmationExandPopupWindowActioncontain commented-out properties and logic for dialog auto-close/timeout (Timeout,TimeoutResult,TimeoutInterval). This feature was partially implemented but disabled. -
Legacy
CenterOverAssociatedObjectproperty: TheCenterOverAssociatedObjectPropertyis registered but its usage inInvokeis commented out.StartupPositionis the current mechanism. -
Default dependency property values:
IsModalandAllowMultipleNotificationWindowsdefault tonull(viaPropertyMetadata(null)), which boxes tofalsewhen cast. This is unconventional—typically defaults are explicitfalse. -
Image path relies on assembly structure:
GetImageUriconstructs pack URIs expecting images in anImages/folder within the executing assembly. Relocation of image resources will break this.