Files
DP44/docs/ai/DataPRO/Modules/Menu/HamburgerMenu/ViewModel.md
2026-04-17 14:55:32 -04:00

2.0 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
DataPRO/Modules/Menu/HamburgerMenu/ViewModel/HamburgerMenuViewModel.cs
2026-04-17T16:00:35.473048+00:00 zai-org/GLM-5-FP8 1 5984a297f98a5ac4

HamburgerMenuViewModel Documentation

1. Purpose

HamburgerMenuViewModel is a Prism/Unity-based ViewModel that manages a hamburger menu's context menu construction, UI state (enabled/busy states), and event-driven communication within the application. It serves as the presentation logic layer for IHamburgerMenuView, handling menu item configuration, notification popups, and test lifecycle state changes via event aggregation. The class is designed as a shared singleton via MEF's [PartCreationPolicy(CreationPolicy.Shared)].


2. Public Interface

Constructor

public HamburgerMenuViewModel(
    IHamburgerMenuView view, 
    IRegionManager regionManager,
    IEventAggregator eventAggregator, 
    IUnityContainer unityContainer)

Initializes the ViewModel, sets the View's DataContext, creates interaction requests, and subscribes to three events: RaiseNotification, BusyIndicatorChangeNotification, and TestEvent.

Properties

Property Type Access
View IHamburgerMenuView get/set
NotificationRequest InteractionRequest<Notification> get
ConfirmationRequest InteractionRequest<Confirmation> get
IsEnabled bool get; private set
IsBusy bool get; set
IsDirty bool get; private set
IsMenuIncluded bool get; set
IsNavigationIncluded bool get; set
MenuItemPressed MenuItemPressedDelegate get; set

Methods

public ContextMenu GetContextMenu()

Returns the cached ContextMenu, building it lazily on first access. Thread-safe via lock on MyLock.

public void SetMenuItems(string[] items)

Replaces the current menu items array and rebuilds the context menu. Empty or whitespace items