2.9 KiB
2.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | ||
|---|---|---|---|---|---|---|
|
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
IsEnabledis read-only; state changes must go throughEnableMenu(bool).- The
MenuItemPresseddelegate may be null; callers should check before invoking. SetMenuItemsaccepts astring[]array; null handling behavior is unspecified.
Dependencies
- Depends on:
DTS.Common.Base(forIBaseView,IBaseViewModel) - Depends on:
System.Windows.Controls(forContextMenu) - Consumers: Any module that needs to provide hamburger menu navigation functionality.
Gotchas
- The XML documentation comment on
IHamburgerMenuViewModelincorrectly 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/IsEnabledmechanism was added to address this. - The relationship between
SetMenuItemsandGetContextMenuis unclear — whether they operate on the same menu or different menus is not specified in the interface.