5.6 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T13:57:29.392045+00:00 | zai-org/GLM-5-FP8 | 1 | 17ac7f526470fc92 |
Documentation: NavigationViewModel
1. Purpose
The NavigationViewModel class serves as the view model for the navigation component within the DTS Viewer application. It acts as a mediator between the INavigationView and the application's navigation infrastructure, managing the content displayed in the navigation region and handling notification events via Prism's IEventAggregator. This class inherits from BaseViewModel<INavigationViewModel> and implements INavigationViewModel, providing data binding context for the navigation view and supporting interaction requests for notifications and confirmations.
2. Public Interface
Constructor
public NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
Initializes a new instance of NavigationViewModel. Sets the view's DataContext to itself, creates new NotificationRequest and ConfirmationRequest instances, stores references to the event aggregator and Unity container, and subscribes to the RaiseNotification event.
Properties
| Property | Type | Description |
|---|---|---|
NavigationView |
INavigationView |
Gets the associated navigation view instance. Set once in constructor. |
NotificationRequest |
InteractionRequest<Notification> |
Interaction request for displaying notifications to the user. |
ConfirmationRequest |
InteractionRequest<Confirmation> |
Interaction request for displaying confirmation dialogs. Declared with new keyword. |
ContextNavigationRegion |
object |
Gets or sets the content of the navigation region. Getter/setter directly access ((NavigationView)NavigationView).NavigationRegion.Content. Raises PropertyChanged on set. |
HeaderInfo |
string |
Returns the constant string "NavigationRegion". |
IsBusy |
bool |
Getter and setter both throw NotImplementedException. Declared with new keyword. |
IsDirty |
bool |
Getter throws NotImplementedException. Declared with new keyword. |
IsNavigationIncluded |
bool |
Get/set property. Declared with new keyword. |
Methods
public override void Initialize()
Overrides base Initialize(). Empty implementation.
public override void Initialize(object parameter)
Overrides base Initialize(object). Casts parameter to IBaseViewModel and assigns it to the private Parent property.
Events
public new event PropertyChangedEventHandler PropertyChanged
Event for property change notifications. Declared with new keyword, hiding the base class event.
3. Invariants
NavigationViewis assigned exactly once in the constructor and is never null thereafter (assumes constructor parameter is non-null).NotificationRequestandConfirmationRequestare instantiated in the constructor and remain non-null for the lifetime of the view model.- The
HeaderInfoproperty always returns the literal string"NavigationRegion". IsBusyandIsDirtyproperties will always throwNotImplementedExceptionwhen accessed.- The view model subscribes to
RaiseNotificationevent during construction; the subscription persists for the object's lifetime.
4. Dependencies
This Module Depends On:
DTS.Common.Base— ProvidesBaseViewModel<T>andIBaseViewModelDTS.Common.Events— ProvidesRaiseNotificationevent andNotificationContentEventArgsDTS.Common.Interactivity— ProvidesInteractionRequest<T>,Notification,ConfirmationDTS.Common.Interface— ProvidesINavigationView,INavigationViewModelPrism.Events— ProvidesIEventAggregatorPrism.Regions— ProvidesIRegionManagerUnity— ProvidesIUnityContainer
What Depends On This Module:
- Cannot be determined from source alone. The
INavigationViewModelinterface suggests other modules may reference this view model through its interface abstraction.
5. Gotchas
-
Multiple
newkeyword usages: The propertiesConfirmationRequest,IsBusy,IsDirty,IsNavigationIncluded, thePropertyChangedevent, and theOnPropertyChangedmethod are all declared withnew, hiding base class members. This indicates a design issue where the base class and derived class have conflicting member signatures. Callers casting to the base type will not see these overridden members. -
NotImplementedException on
IsBusyandIsDirty: Accessing either property will always throw. Code that attempts to bind to or check these properties will fail at runtime. -
Unused
ConfirmationRequest: TheConfirmationRequestproperty is instantiated but never raised anywhere in this class. It may be dead code or intended for future use. -
Concrete type cast in
ContextNavigationRegion: The property castsINavigationView NavigationViewto the concrete typeNavigationViewto accessNavigationRegion.Content. This breaks the interface abstraction and creates tight coupling to the concrete view implementation. -
Parentproperty never used: TheParentproperty is set inInitialize(object parameter)but never referenced elsewhere in this file. Its purpose is unclear from source alone. -
Suppressed ReSharper warnings: The file includes pragma-like comments suppressing warnings about unaccessed fields and unused auto-property accessors, suggesting known code quality issues that were silenced rather than resolved.