The DTS.Common.Dialogs namespace provides infrastructure for displaying modal and non-modal dialogs within a WPF application, specifically designed to work with the Prism framework's InteractionRequest patterns. It bridges the gap between view-model interaction requests and actual window display via PopupWindowAction, supports region management within popups through IRegionManagerAware, and offers specialized window implementations for confirmations and notifications. Additionally, it provides a managed wrapper around the Win32 SHBrowseForFolder API for folder selection dialogs.
bool CenterOverAssociatedObject — Note: Usage appears commented out in logic.
bool AllowMultipleNotificationWindows
Methods:
protected override void Invoke(object parameter): Executes the trigger, creates the window, sets up positioning, and shows it (modal or non-modal).
protected void PrepareContentForWindow(Notification notification, Window wrapperWindow): Injects RegionManager, HostWindow, and HostNotification into the view if the view or its DataContext implements the aware interfaces.
protected Window GetWindow(Notification notification): Factory method returning a generic window or a specific ConfirmationWindow/NotificationWindow.
protected Window CreateWindow(Notification notification): Creates the specific window instance based on notification type.
BrowseForFolderDialog
Constructors:public BrowseForFolderDialog() (Sets default flags to BIF_NEWDIALOGSTYLE)
Properties:
string SelectedFolder
string Title
string InitialFolder
string InitialExpandedFolder
string OKButtonText
BROWSEINFOW BrowseInfo
BrowseInfoFlags BrowserDialogFlags
Methods:
public Nullable<bool> ShowDialog()
public Nullable<bool> ShowDialog(Window owner)
Nested Types:
enum BrowseInfoFlags (Flags enum for BIF_* constants)
class BROWSEINFOW (Win32 structure wrapper)
enum MessageFromBrowser
enum MessageToBrowser
delegate int BrowseCallbackProc(...)
Invariants
Window System Menu Removal: Both ConfirmationWindow and NotificationWindow will always have the WS_SYSMENU style bit removed during SourceInitialized. This effectively hides the system menu and the close button on the title bar.
Region Management: If PopupWindowAction creates a window with WindowContent, and that content does not already have a RegionManager, a new scoped RegionManager is automatically created and attached.
Parent Check:PopupWindowAction.Invoke will return and do nothing if WindowContent is already part of a visual tree (i.e., WindowContent.Parent is not null).
Notification Content Requirement: When PopupWindowAction creates a NotificationWindow (no WindowContent provided), the Notification.Content property must be castable to NotificationContentEventArgs; otherwise, the method returns null and no window is displayed.
Modal vs Non-Modal: If IsModal is true, ShowDialog() is called; otherwise, Show() is called.