TablesSettingsViewModel is the view model for the Tables Settings module within the application’s UI layer. It acts as the data context for ITablesSettingsView, coordinating UI state (e.g., busy status, menu/navigation visibility) and bridging communication between the view and the application’s event infrastructure via IEventAggregator. It also exposes InteractionRequests to support modal notifications and confirmations through Prism’s interaction patterns. This module is part of a modular, MEF-exported component system and is intended to be shared across the application lifecycle.
2. Public Interface
Class: TablesSettingsViewModel
Exported as:[Export(typeof(ITablesSettingsView))] — implies it is intended to be resolved as an ITablesSettingsView (likely via MEF or Unity).
Creation Policy:Shared — only one instance exists per application lifetime.
Properties
Property
Type
Description
View
ITablesSettingsView
Reference to the associated view; set in constructor.
NotificationRequest
InteractionRequest<Notification>
Used to trigger display of notification popups (e.g., informational messages).
ConfirmationRequest
InteractionRequest<Confirmation>
Used to trigger confirmation dialogs.
IsDirty
bool
Read-only; currently always false (no logic implemented to set it).
IsBusy
bool
Gets/sets busy state; raises PropertyChanged on change.
IsMenuIncluded
bool
Gets/sets whether the menu is included in the view; raises PropertyChanged.
IsNavigationIncluded
bool
Gets/sets whether navigation is included in the view; raises PropertyChanged.
Transforms NotificationContentEventArgs (with title/message/image) into a Notification object and raises NotificationRequest. Note: it discards the Title and Image fields of the original event args and passes them via NotificationContentEventArgs constructor with empty strings for some parameters — see Gotchas.
[Export(typeof(ITablesSettingsView))] — indicates this type is registered as an export for ITablesSettingsView.
UI Framework:
Prism.Regions, Prism.Events, Prism.Interactivity — used for region management, event aggregation, and interaction requests.
Depended Upon By
The view (ITablesSettingsView) — this view model is bound to its DataContext.
Likely consumed via MEF/Unity resolution as ITablesSettingsView.
Other modules may publish RaiseNotification or BusyIndicatorChangeNotification events to trigger UI feedback via this view model.
5. Gotchas
SetProperty is unimplemented — throws NotImplementedException. This breaks expected MVVM patterns (e.g., INotifyPropertyChanged helpers). Developers should avoid calling it.
NotificationContentEventArgs transformation in OnRaiseNotification is lossy:
The method constructs a new NotificationContentEventArgs with empty strings for the 2nd and 4th parameters (likely OkContent and CancelContent), discarding any original values. This may cause unexpected behavior if callers expect those fields to be preserved.
No-op lifecycle methods: Initialize, InitializeAsync, Activated, Cleanup, and CleanupAsync contain no logic — may indicate incomplete implementation or deferred functionality.
IsDirty is never set: Despite being a public property, it is never assigned — always false. This may mislead consumers expecting dirty-state tracking.
HeaderInfo is hardcoded: Always returns "MainRegion" — no dynamic behavior or configuration.
IBasePropertyChanged.OnPropertyChanged is implemented explicitly — only callable via interface cast.
Thread context for BusyIndicatorChangeNotification: Subscribed with ThreadOption.PublisherThread, meaning the handler runs on the publisher’s thread — may require dispatcher marshaling if the publisher is not on the UI thread (though IsBusy setter calls OnPropertyChanged, which should marshal to UI thread if INotifyPropertyChanged is handled by Prism’s binding system).
Documentation generated from source file TablesSettingsViewModel.cs only. No external behavior or assumptions beyond what is visible in the source.