5.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T14:03:50.492383+00:00 | zai-org/GLM-5-FP8 | 1 | 6bc81faa835eebdc |
DockPanelHorizontalViewModel Documentation
1. Purpose
DockPanelHorizontalViewModel is a ViewModel component within a WPF/Prism-based MVVM architecture, responsible for managing the state and behavior of a horizontal dock panel view. It serves as a mediator between the view (IDockPanelHorizontalView) and the application's infrastructure (region navigation, event aggregation, dependency injection). The class currently provides a functional notification system while the majority of its lifecycle methods remain unimplemented stubs.
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 interaction requests, and subscribes to the RaiseNotification event.
Properties
| Property | Type | Access | Description |
|---|---|---|---|
View |
IDockPanelHorizontalView |
get |
The associated view instance. |
NotificationRequest |
InteractionRequest<Notification> |
get |
Prism interaction request for displaying notifications. |
ConfirmationRequest |
InteractionRequest<Confirmation> |
get |
Prism interaction request for displaying confirmations. |
IsMenuIncluded |
bool |
get; set |
Flag indicating whether a menu is included. |
IsNavigationIncluded |
bool |
get; set |
Flag indicating whether navigation is included. |
IsBusy |
bool |
get; set |
Indicates if the ViewModel is in a busy state. |
IsDirty |
bool |
get; private set |
Indicates if there are unsaved changes. |
Events
public event PropertyChangedEventHandler PropertyChanged;
Standard property-changed event for data binding.
Methods (Override/New)
| Method | Signature | Implementation Status |
|---|---|---|
Initialize |
override void Initialize() |
Throws NotImplementedException |
Initialize |
override void Initialize(object parameter) |
Throws NotImplementedException |
Initialize |
new void Initialize(object parameter, object model) |
Throws NotImplementedException |
InitializeAsync |
override Task InitializeAsync() |
Throws NotImplementedException |
InitializeAsync |
override Task InitializeAsync(object parameter) |
Throws NotImplementedException |
Activated |
override void Activated() |
Throws NotImplementedException |
Cleanup |
override void Cleanup() |
Throws NotImplementedException |
CleanupAsync |
new Task CleanupAsync() |
Throws NotImplementedException |
3. Invariants
- DataContext Binding: The
View.DataContextis always set tothisupon construction. - Event Subscription: The
RaiseNotificationevent subscription is established in the constructor and remains active for the lifetime of the ViewModel. - IsDirty Encapsulation: The
IsDirtyproperty can only be modified internally (private setter). - Base Class Contract: Inherits from
BaseViewModel<IDockPanelHorizontalViewModel>and implementsIDockPanelHorizontalViewModel.
4. Dependencies
External Dependencies (from imports)
Microsoft.Practices.Prism.Events-IEventAggregatorfor pub/sub event handlingMicrosoft.Practices.Prism.Interactivity.InteractionRequest-InteractionRequest<T>,Notification,Confirmationfor UI dialogsMicrosoft.Practices.Prism.Regions-IRegionManagerfor region-based navigationMicrosoft.Practices.Unity-IUnityContainerfor dependency injection
Internal Dependencies
DTS.Common.Base- ProvidesBaseViewModel<T>DTS.Common.Events- ProvidesRaiseNotificationevent andNotificationContentEventArgsDTS.Common.Interface- ProvidesIViewModel,IDockPanelHorizontalViewModel,IDockPanelHorizontalView
Dependents
- Cannot be determined from this source file alone.
5. Gotchas
-
Incomplete Implementation: All lifecycle methods (
Initialize,InitializeAsync,Activated,Cleanup,CleanupAsync) throwNotImplementedException. Calling these will crash the application. -
Method Hiding with
newKeyword:CleanupAsync()andInitialize(object, object)usenewrather thanoverride, meaning they hide base class members. Calls through a base class reference will invoke the base implementation, not these methods.
-
Field Hiding: The
_regionManagerfield is declared withnew, hiding any base class field of the same name. This may cause confusion about which instance is being used. -
Redundant PropertyChanged Event: The class declares
PropertyChangedevent, butBaseViewModellikely already implementsINotifyPropertyChanged. This could cause issues if the base relies on its own event declaration. -
Legacy Prism Version: Uses
Microsoft.Practices.Prismnamespace, indicating an older version of Prism (pre-6.x). Modern Prism usesPrismnamespace. -
Unused ConfirmationRequest:
ConfirmationRequestis instantiated but never raised anywhere in this class. Its intended usage is unclear from this source. -
Unused Private Members:
Parent,_regionManager, andUnityContainerare stored but never used in any implemented method.