5.5 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T14:04:21.621857+00:00 | zai-org/GLM-5-FP8 | 1 | 0185c1c3d29b204b |
DockPanelVerticalViewModel Documentation
1. Purpose
DockPanelVerticalViewModel is a ViewModel component for a vertical dock panel UI element within a WPF/Prism-based application. It serves as a container view model that manages notification and confirmation dialogs via Prism's InteractionRequest pattern, and exposes state properties for menu and navigation inclusion. The class inherits from BaseViewModel<IDockPanelVerticalViewModel> and implements the IDockPanelVerticalViewModel interface, participating in Prism's region navigation and event aggregation system.
2. Public Interface
Constructor
public DockPanelVerticalViewModel(
IDockPanelVerticalView view,
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
Initializes the view model, sets the View's DataContext to itself, creates NotificationRequest and ConfirmationRequest instances, and subscribes to the RaiseNotification event via the event aggregator.
Properties
| Property | Type | Access |
|---|---|---|
View |
IDockPanelVerticalView |
public get; private set |
NotificationRequest |
InteractionRequest<Notification> |
public get; private set |
ConfirmationRequest |
InteractionRequest<Confirmation> |
public get; private set |
IsMenuIncluded |
bool |
public get; set |
IsNavigationIncluded |
bool |
public get; set |
IsBusy |
bool |
public get; set |
IsDirty |
bool |
public get; private set |
Events
public event PropertyChangedEventHandler PropertyChanged;
Declared but never invoked within this class.
Lifecycle Methods (All Throw NotImplementedException)
| Method | Signature |
|---|---|
Initialize() |
public override void Initialize() |
Initialize(object) |
public override void Initialize(object parameter) |
Activated() |
public override void Activated() |
Cleanup() |
public override void Cleanup() |
CleanupAsync() |
public new Task CleanupAsync() |
Initialize(object, object) |
public new void Initialize(object parameter, object model) |
InitializeAsync() |
public override Task InitializeAsync() |
InitializeAsync(object) |
public override Task InitializeAsync(object parameter) |
Private Event Handler
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
Handles RaiseNotification events by creating a new NotificationContentEventArgs (without title) and raising the NotificationRequest with both content and title extracted from the original event args.
3. Invariants
- DataContext Binding: The View's
DataContextis always set to the ViewModel instance upon construction. - InteractionRequest Initialization:
NotificationRequestandConfirmationRequestare never null after construction. - Event Subscription: The view model is always subscribed to
RaiseNotificationevent after construction (no unsubscribe logic is visible). - IsDirty Encapsulation:
IsDirtycan only be modified internally (private setter).
4. Dependencies
This Module Depends On:
DTS.Common.Base— ProvidesBaseViewModel<T>DTS.Common.Events— ProvidesRaiseNotificationevent class andNotificationContentEventArgsDTS.Common.Interface— ProvidesIDockPanelVerticalViewModel,IViewModel,IDockPanelVerticalViewMicrosoft.Practices.Prism.Events—IEventAggregatorMicrosoft.Practices.Prism.Interactivity.InteractionRequest—InteractionRequest<T>,Notification,ConfirmationMicrosoft.Practices.Prism.Regions—IRegionManagerMicrosoft.Practices.Unity—IUnityContainer
What Depends On This Module:
Cannot be determined from source alone. The consumers of IDockPanelVerticalViewModel or DockPanelVerticalViewModel are not visible in this file.
5. Gotchas
-
Incomplete Implementation: All lifecycle methods (
Initialize,Activated,Cleanup, and their async variants) throwNotImplementedException. This class appears to be a stub or work-in-progress. -
Method Hiding with
newKeyword:CleanupAsync()andInitialize(object, object)usenewinstead ofoverride, hiding base class members. This may cause unexpected behavior when calling through base class references.
-
Field Shadowing: The
_regionManagerfield is declared withnew, suggesting it shadows a base class member. The reason for this is unclear from source alone. -
Unused
PropertyChangedEvent: ThePropertyChangedevent is declared but never raised. Property setters forIsMenuIncluded,IsNavigationIncluded, andIsBusydo not trigger change notifications, which may break UI binding updates. -
No Unsubscribe Logic: The subscription to
RaiseNotificationevent in the constructor has no corresponding unsubscribe in any cleanup method. This could cause memory leaks if view model instances are not properly garbage collected. -
Data Transformation in
OnRaiseNotification: The handler creates a newNotificationContentEventArgsobject from the received one, separating title from content. This transformation may be intentional but appears redundant without additional context.