5.8 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T11:24:52.139730+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 events via IEventAggregator and exposing a ContextNavigationRegion property for dynamically setting navigation content. This class inherits from BaseViewModel<INavigationViewModel> and implements the INavigationViewModel interface.
2. Public Interface
Constructor
public NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
Initializes the view model with its associated view and Prism infrastructure dependencies. Sets the view's DataContext to itself, initializes interaction requests, and subscribes to the RaiseNotification event.
Properties
| Property | Type | Access | Description |
|---|---|---|---|
NavigationView |
INavigationView |
get; private set; |
The associated navigation view instance. |
NotificationRequest |
InteractionRequest<Notification> |
get; private set; |
Interaction request for displaying notifications. |
ConfirmationRequest |
InteractionRequest<Confirmation> |
get; private set; |
Interaction request for displaying confirmations. |
ContextNavigationRegion |
object |
get; set; |
Gets or sets the content of the NavigationRegion on the underlying view. Raises OnPropertyChanged on set. |
HeaderInfo |
string |
get; |
Returns the constant string "NavigationRegion". |
IsBusy |
bool |
get; set; |
Throws NotImplementedException in both getter and setter. |
IsDirty |
bool |
get; |
Throws NotImplementedException in getter. |
Events
public new event PropertyChangedEventHandler PropertyChanged;
Hides the base class event. Raised via the private OnPropertyChanged(string propertyName) method.
Methods
| Method | Return Type | Description |
|---|---|---|
Initialize() |
void |
Empty override; performs no initialization. |
Initialize(object parameter) |
void |
Sets the Parent property by casting parameter to IShellViewModel. |
Activated() |
void |
Throws NotImplementedException. |
Cleanup() |
void |
Throws NotImplementedException. |
CleanupAsync() |
Task |
Throws NotImplementedException. |
InitializeAsync() |
Task |
Throws NotImplementedException. |
InitializeAsync(object parameter) |
Task |
Throws NotImplementedException. |
Private Methods
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
Event handler for RaiseNotification events. Transforms NotificationContentEventArgs into a NotificationContentEventArgs (without title) and raises the NotificationRequest with separate content and title.
3. Invariants
NavigationViewis assigned in the constructor and never reassigned.Parentis only set viaInitialize(object parameter)and must be castable toIShellViewModel.- The
RaiseNotificationevent subscription is established at construction time and remains active for the lifetime of the view model. ContextNavigationRegionassumes the underlyingNavigationViewcan be cast to the concreteNavigationViewtype to accessNavigationRegion.Content.
4. Dependencies
This module depends on:
DTS.Common.Base— ProvidesBaseViewModel<T>DTS.Common.Events— ProvidesRaiseNotificationevent andNotificationContentEventArgsDTS.Common.Interface— ProvidesINavigationViewModel,INavigationView,IShellViewModelMicrosoft.Practices.Prism.Events— ProvidesIEventAggregatorMicrosoft.Practices.Prism.Interactivity.InteractionRequest— ProvidesInteractionRequest<T>,Notification,ConfirmationMicrosoft.Practices.Prism.Regions— ProvidesIRegionManagerMicrosoft.Practices.Unity— ProvidesIUnityContainer
What depends on this module:
- Cannot be determined from source alone (no consumers visible in this file).
5. Gotchas
-
Incomplete Implementation: Multiple methods (
Activated,Cleanup,CleanupAsync,InitializeAsync,InitializeAsync(object parameter)) and properties (IsBusy,IsDirty) throwNotImplementedException. This class appears to be partially implemented. -
Member Hiding: The
newkeyword is used to hide base class members (PropertyChanged,OnPropertyChanged,IsBusy,IsDirty,CleanupAsync). This may indicate a design issue or conflict with the baseBaseViewModel<T>implementation. -
Stale XML Documentation: The constructor's XML comment states "Creates a new instance of the TechnologyDoFrontEditViewModel" — this appears to be a copy-paste error from another view model.
-
Unsafe Cast in ContextNavigationRegion: The property directly casts
INavigationViewto the concreteNavigationViewtype:((NavigationView)NavigationView).NavigationRegion.ContentThis will throw an
InvalidCastExceptionat runtime if the injected view is not exactly of typeNavigationView. -
Event Transformation Logic:
OnRaiseNotificationcreates a newNotificationContentEventArgsfrom the received event args, extractingMessage,MessageDetails, andImagewhile separatingTitle. This transformation may lose data if additional properties exist on the source event args.