This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
---
source_files:
- Common/DTS.Common/Interface/Menu/HamburgerMenu/IHamburgerMenuView.cs
- Common/DTS.Common/Interface/Menu/HamburgerMenu/IHamburgerMenuViewModel.cs
generated_at: "2026-04-17T16:07:58.358969+00:00"
model: "zai-org/GLM-5-FP8"
schema_version: 1
sha256: "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.
---