5.4 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T14:03:49.797600+00:00 | zai-org/GLM-5-FP8 | 1 | a00beb6f74b53389 |
Documentation: NavigationViewModel
1. Purpose
NavigationViewModel is a Prism-based ViewModel responsible for managing the navigation region within the DTS Viewer application's shell. It serves as a mediator between the INavigationView and the application's navigation infrastructure, handling notification popups via InteractionRequest and providing a bindable ContextNavigationRegion property for dynamic content injection. The class inherits from BaseViewModel<INavigationViewModel> and implements INavigationViewModel.
2. Public Interface
Constructor
public NavigationViewModel(
INavigationView view,
IRegionManager regionManager,
IEventAggregator eventAggregator,
IUnityContainer unityContainer)
Initializes the ViewModel, sets the view's DataContext to itself, creates NotificationRequest and ConfirmationRequest instances, and subscribes to the RaiseNotification event via the EventAggregator.
Properties
| Property | Type | Access | Description |
|---|---|---|---|
NavigationView |
INavigationView |
get |
Stores the associated view instance. |
NotificationRequest |
InteractionRequest<Notification> |
get |
Used to raise notification dialogs. |
ConfirmationRequest |
InteractionRequest<Confirmation> |
get |
Used to raise confirmation dialogs. |
ContextNavigationRegion |
object |
get/set |
Gets or sets the content of the NavigationRegion on the view. Raises OnPropertyChanged on set. |
HeaderInfo |
string |
get |
Returns the constant string "NavigationRegion". |
IsBusy |
bool |
get/set |
Throws NotImplementedException. |
IsDirty |
bool |
get |
Throws NotImplementedException. |
Methods
| Method | Return Type | Description |
|---|---|---|
Initialize() |
void |
Override. Empty implementation. |
Initialize(object parameter) |
void |
Override. Casts parameter to IShellViewModel and assigns to Parent field. |
Activated() |
void |
Override. Throws NotImplementedException. |
Cleanup() |
void |
Override. Throws NotImplementedException. |
CleanupAsync() |
Task |
Throws NotImplementedException. |
InitializeAsync() |
Task |
Override. Throws NotImplementedException. |
InitializeAsync(object parameter) |
Task |
Override. Throws NotImplementedException. |
Events
| Event | Type | Description |
|---|---|---|
PropertyChanged |
PropertyChangedEventHandler |
Declared with new keyword, hiding the base implementation. Raised via OnPropertyChanged. |
3. Invariants
NavigationViewis set once in the constructor and never reassigned.ContextNavigationRegionalways accesses((NavigationView)NavigationView).NavigationRegion.Content, requiring the concreteNavigationViewtype.HeaderInfoalways returns the literal string"NavigationRegion".- The
RaiseNotificationevent subscription is established at construction time and never unsubscribed. Parentis only set viaInitialize(object parameter)and expects anIShellViewModelinstance.
4. Dependencies
This module depends on:
DTS.Common.Base—BaseViewModel<T>DTS.Common.Events—RaiseNotificationevent,NotificationContentEventArgs,NotificationContentEventArgsWithoutTitle(implied by usage)DTS.Common.Interface—INavigationViewModel,INavigationView,IShellViewModelMicrosoft.Practices.Prism.Events—IEventAggregatorMicrosoft.Practices.Prism.Interactivity.InteractionRequest—InteractionRequest<T>,Notification,ConfirmationMicrosoft.Practices.Prism.Regions—IRegionManagerMicrosoft.Practices.Unity—IUnityContainer
What depends on this module:
- Unclear from source alone — The
IShellViewModelinterface suggests a parent shell consumes this ViewModel, but the exact consumers are not visible in this file.
5. Gotchas
-
Many members throw
NotImplementedException:IsBusy,IsDirty,Activated(),Cleanup(),CleanupAsync(),InitializeAsync(), andInitializeAsync(object parameter)are all stubs that will crash if invoked. This indicates incomplete implementation. -
Broken abstraction in
ContextNavigationRegion: The property castsINavigationViewto the concreteNavigationViewtype to accessNavigationRegion.Content. This violates the interface contract and creates tight coupling. -
Incorrect XML documentation: The constructor's XML comment states it "Creates a new instance of the TechnologyDoFrontEditViewModel" — this is a copy-paste error and does not match the actual class name.
-
Event hiding: The
PropertyChangedevent andOnPropertyChangedmethod are declared withnew, hiding the base class implementation. This could lead to unexpected behavior if consumers expect the base event to fire. -
No event unsubscription: The
RaiseNotificationevent subscription in the constructor has no corresponding unsubscription inCleanup()(which throws anyway), potentially causing memory leaks. -
Commented-out dead code: A
GetRegions()method is entirely commented out, suggesting unfinished or abandoned functionality.