5.6 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-16T11:19:33.784254+00:00 | zai-org/GLM-5-FP8 | 1 | 17ac7f526470fc92 |
Documentation: NavigationViewModel
1. Purpose
NavigationViewModel is a ViewModel component responsible for managing the navigation UI region within the DTS Viewer application. It serves as a mediator between the INavigationView and the application's navigation system, handling notification and confirmation dialogs via Prism's interaction request patterns. The class inherits from BaseViewModel<INavigationViewModel> and implements INavigationViewModel, integrating with the Prism/Unity dependency injection and region management framework.
2. Public Interface
Constructor
public NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
Initializes the navigation view model with its dependencies. Sets the view's DataContext to itself, creates NotificationRequest and ConfirmationRequest instances, and subscribes to the RaiseNotification event via the event aggregator.
Properties
| Property | Signature | Description |
|---|---|---|
NavigationView |
INavigationView { get; private set; } |
Holds the associated navigation view instance. |
NotificationRequest |
InteractionRequest<Notification> { get; private set; } |
Interaction request for displaying notifications. |
ConfirmationRequest |
new InteractionRequest<Confirmation> { get; private set; } |
Interaction request for displaying confirmations. Hides base member. |
ContextNavigationRegion |
object { get; set; } |
Gets or sets the content of the NavigationRegion on the concrete NavigationView. Raises OnPropertyChanged on set. |
HeaderInfo |
string { get; } |
Returns the constant string "NavigationRegion". |
IsBusy |
new bool { get; set; } |
Throws NotImplementedException on both getter and setter. Hides base member. |
IsDirty |
new bool { get; } |
Throws NotImplementedException on getter. Hides base member. |
IsNavigationIncluded |
new bool { get; set; } |
Auto-property hiding base member. |
Events
| Event | Signature | Description |
|---|---|---|
PropertyChanged |
new event PropertyChangedEventHandler |
Hides the base class event. Invoked via OnPropertyChanged. |
Methods
| Method | Signature | Description |
|---|---|---|
Initialize |
override void Initialize() |
Empty override. No initialization logic. |
Initialize |
override void Initialize(object parameter) |
Casts parameter to IBaseViewModel and assigns to private Parent field. |
OnRaiseNotification |
void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle) |
Private event handler. Converts NotificationContentEventArgs to NotificationContentEventArgsWithoutTitle and raises the NotificationRequest. |
3. Invariants
NavigationViewis assigned in the constructor and is expected to be non-null throughout the instance lifetime.- The
DataContextofNavigationViewis always set tothis(the ViewModel itself). NotificationRequestandConfirmationRequestare initialized in the constructor and never reassigned.- The
RaiseNotificationevent subscription is established at construction time and remains active for the instance lifetime. ContextNavigationRegionproperty getter assumesNavigationViewcan be cast to the concreteNavigationViewtype and thatNavigationRegionis non-null.
4. Dependencies
This module depends on:
DTS.Common.Base—BaseViewModel<T>,IBaseViewModelDTS.Common.Events—RaiseNotification(event),NotificationContentEventArgsDTS.Common.Interactivity—InteractionRequest<T>,Notification,ConfirmationDTS.Common.Interface—INavigationViewModel,INavigationViewPrism.Events—IEventAggregatorPrism.Regions—IRegionManagerUnity—IUnityContainer
Consumers:
- Not determinable from this source file alone. The class is public and designed for use by other modules in the DTS.Viewer application.
5. Gotchas
-
Member hiding with
newkeyword: Multiple members (ConfirmationRequest,IsBusy,IsDirty,IsNavigationIncluded,PropertyChanged) usenewto hide base class members. This can cause confusion when casting to base types or interfaces, as the hidden members will not be invoked. -
NotImplementedException on
IsBusyandIsDirty: Both properties throwNotImplementedExceptionon access. Calling code must not attempt to read or write these properties. -
Concrete type cast in
ContextNavigationRegion: The property castsINavigationView NavigationViewto the concreteNavigationViewtype to accessNavigationRegion.Content. This breaks the abstraction provided by the interface and creates tight coupling to the concrete view implementation. -
Unused private fields:
Parent,EventAggregator, andUnityContainerare stored as private fields butParentis only assigned (never read), andEventAggregator/UnityContainerare only used for subscription in the constructor. This may indicate incomplete implementation or dead code. -
ReSharper suppression directives: The file contains multiple
// ReSharper disablecomments (CheckNamespace,NotAccessedField.Local,UnusedAutoPropertyAccessor.Local,AutoPropertyCanBeMadeGetOnly.Local), suggesting known code quality issues that have been suppressed rather than addressed.