Files
DP44/docs/ai/Common/DTS.Common/Interface/Menu/HamburgerMenu.md
2026-04-17 14:55:32 -04:00

2.9 KiB

source_files, generated_at, model, schema_version, sha256
source_files generated_at model schema_version sha256
Common/DTS.Common/Interface/Menu/HamburgerMenu/IHamburgerMenuView.cs
Common/DTS.Common/Interface/Menu/HamburgerMenu/IHamburgerMenuViewModel.cs
2026-04-17T16:07:58.358969+00:00 zai-org/GLM-5-FP8 1 760e48ac189ee322

HamburgerMenu

Purpose

This module defines the contract for a hamburger menu navigation component used for group channel navigation. The ViewModel manages menu item lifecycle (set/clear), context menu generation, and handles user interaction via a delegate callback when menu items are pressed. It supports enabling/disabling the menu state, which addresses a historical issue (reference #15324) where warning dialogs were displayed on every tab change.

Public Interface

IHamburgerMenuView (extends IBaseView)

  • Empty interface serving as a marker type for Hamburger Menu views. XML documentation describes it as "view for group channels."

IHamburgerMenuViewModel (extends IBaseViewModel)

  • IHamburgerMenuView View { get; set; } — Gets or sets the associated view instance.
  • void OnSetActive() — Called when the view is loaded; performs any necessary initialization work.
  • void Unset() — Called when the view is unloaded; performs cleanup work.
  • ContextMenu GetContextMenu() — Returns the context menu for the hamburger menu.
  • void SetMenuItems(string[] items) — Sets the menu items to display.
  • void ClearMenuItems() — Clears all menu items.
  • MenuItemPressedDelegate MenuItemPressed { get; set; } — Delegate handler invoked when a menu item is pressed.
  • bool IsEnabled { get; } — Returns whether the hamburger menu is currently enabled.
  • void EnableMenu(bool enable) — Enables or disables the hamburger menu.

MenuItemPressedDelegate

  • delegate void MenuItemPressedDelegate(string command) — Callback signature for menu item press events, receiving a string command identifier.

Invariants

  • IsEnabled is read-only; state changes must go through EnableMenu(bool).
  • The MenuItemPressed delegate may be null; callers should check before invoking.
  • SetMenuItems accepts a string[] array; null handling behavior is unspecified.

Dependencies

  • Depends on: DTS.Common.Base (for IBaseView, IBaseViewModel)
  • Depends on: System.Windows.Controls (for ContextMenu)
  • Consumers: Any module that needs to provide hamburger menu navigation functionality.

Gotchas

  • The XML documentation comment on IHamburgerMenuViewModel incorrectly describes it as "the view module for the group import module" — this appears to be copy-paste tech debt.
  • Comment references bug #15324 regarding warning dialogs on tab changes; the EnableMenu/IsEnabled mechanism was added to address this.
  • The relationship between SetMenuItems and GetContextMenu is unclear — whether they operate on the same menu or different menus is not specified in the interface.