6.3 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T11:24:34.196995+00:00 | zai-org/GLM-5-FP8 | 1 | 6bc81faa835eebdc |
DockPanelHorizontalViewModel Documentation
1. Purpose
DockPanelHorizontalViewModel is a ViewModel component within a WPF/Prism-based application that manages the state and behavior of a horizontal dock panel UI element. It inherits from BaseViewModel<IDockPanelHorizontalViewModel> and implements IDockPanelHorizontalViewModel, serving as a coordinator between the view layer and the application's event system. The class provides notification/confirmation dialog support via Prism's InteractionRequest pattern and subscribes to application-wide RaiseNotification events.
2. Public Interface
Constructor
public DockPanelHorizontalViewModel(
IDockPanelHorizontalView view,
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
Initializes the ViewModel, sets the View's DataContext to itself, creates NotificationRequest and ConfirmationRequest instances, stores dependencies, and subscribes to the RaiseNotification event via the EventAggregator.
Properties
| Property | Type | Access | Description |
|---|---|---|---|
View |
IDockPanelHorizontalView |
public get; private set |
Reference to the associated view instance. |
NotificationRequest |
InteractionRequest<Notification> |
public get; private set |
Prism interaction request for displaying notifications. |
ConfirmationRequest |
InteractionRequest<Confirmation> |
public get; private set |
Prism interaction request for displaying confirmation dialogs. |
IsMenuIncluded |
bool |
public get; set |
Flag indicating whether a menu is included. |
IsNavigationIncluded |
bool |
public get; set |
Flag indicating whether navigation is included. |
IsBusy |
bool |
public get; set |
Flag indicating busy/loading state. |
IsDirty |
bool |
public get; private set |
Flag indicating unsaved changes state. |
Events
public event PropertyChangedEventHandler PropertyChanged;
Standard INotifyPropertyChanged event declaration.
Methods
| Method | Return Type | Behavior |
|---|---|---|
Initialize() |
void |
Throws NotImplementedException. |
Initialize(object parameter) |
void |
Throws NotImplementedException. |
Activated() |
void |
Throws NotImplementedException. |
Cleanup() |
void |
Throws NotImplementedException. |
CleanupAsync() |
Task |
Throws NotImplementedException. Marked with new keyword. |
Initialize(object parameter, object model) |
void |
Throws NotImplementedException. Marked with new keyword. |
InitializeAsync() |
Task |
Throws NotImplementedException. |
InitializeAsync(object parameter) |
Task |
Throws NotImplementedException. |
Private Methods
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
Event handler for RaiseNotification events. Extracts Message, MessageDetails, Image, and Title from the received NotificationContentEventArgs, constructs a new NotificationContentEventArgs (without title), and raises the NotificationRequest with a Notification containing the reconstructed content and separate title.
3. Invariants
- The
View.DataContextis set tothis(the ViewModel instance) upon construction and is never changed. NotificationRequestandConfirmationRequestare always non-null after construction.- The
RaiseNotificationevent subscription is established during construction and remains active for the lifetime of the ViewModel (no unsubscription is visible in the source). IsDirtycan only be modified internally (private setter).- The
_regionManagerfield hides a base class member with the same name (vianewkeyword).
4. Dependencies
This Module Depends On
| Namespace | Type(s) Used |
|---|---|
DTS.Common.Base |
BaseViewModel<T> |
DTS.Common.Events |
RaiseNotification, NotificationContentEventArgs |
DTS.Common.Interface |
IViewModel, IDockPanelHorizontalViewModel |
Microsoft.Practices.Prism.Events |
IEventAggregator |
Microsoft.Practices.Prism.Interactivity.InteractionRequest |
InteractionRequest<T>, Notification, Confirmation |
Microsoft.Practices.Prism.Regions |
IRegionManager |
Microsoft.Practices.Unity |
IUnityContainer |
What Depends On This Module
Not determinable from source alone. The module implements IDockPanelHorizontalViewModel, suggesting consumers depend on that interface rather than the concrete class directly.
5. Gotchas
-
Most lifecycle methods are unimplemented:
Initialize(),Initialize(object),Activated(),Cleanup(),CleanupAsync(),Initialize(object, object),InitializeAsync(), andInitializeAsync(object)all throwNotImplementedException. This class appears to be a partial implementation or stub. -
Method hiding with
newkeyword:CleanupAsync()andInitialize(object parameter, object model)usenewrather thanoverride, potentially hiding base class implementations. This may indicate a design inconsistency or versioning artifact. -
Field hiding: The
_regionManagerfield is declared withnew, hiding a base class member. The implications of this depend on the base class implementation. -
Redundant object construction in
OnRaiseNotification: The handler constructs a newNotificationContentEventArgsfrom the received one, passingMessage,MessageDetails, andImageto the constructor. The comment indicates this is intentional ("expects a NotificationContentEventArgsWithoutTitle object"), but the type used isNotificationContentEventArgs. Whether this is correct or a bug is unclear from source alone. -
No event unsubscription: There is no visible unsubscription from
RaiseNotificationin any cleanup method. SinceCleanup()throwsNotImplementedException, memory leaks via event subscription are possible if the base class does not handle this. -
Unused
Parentproperty: TheParentproperty (typeIViewModel) is declared but never assigned or used in the visible source.