1.9 KiB
1.9 KiB
source_files, generated_at, model, schema_version, sha256
| source_files | generated_at | model | schema_version | sha256 | |
|---|---|---|---|---|---|
|
2026-04-17T16:15:25.512508+00:00 | zai-org/GLM-5-FP8 | 1 | c31776c3db4a4afd |
Model
Purpose
This module provides the MenuCommand class, a simple ICommand implementation designed to handle hamburger menu item execution. It serves as a bridge between WPF's command binding system and the application's menu handling logic by invoking a delegate when a menu item is pressed, passing along the menu item's identifier.
Public Interface
MenuCommand class - Implements System.Windows.Input.ICommand
MenuCommand(string id, MenuItemPressedDelegate menuItemPressed)- Constructor. Takes a unique identifier for the menu item and a delegate to invoke upon execution.bool CanExecute(object parameter)- Always returnstrue. The command is always executable.void Execute(object parameter)- Invokes theMenuItemPresseddelegate with the storedId.event EventHandler CanExecuteChanged- StandardICommandevent. Never raised in this implementation.
Invariants
CanExecutewill always returntrueregardless of the parameter value.IdandMenuItemPressedare set at construction and cannot be changed (readonly).MenuItemPresseddelegate must be provided at construction time (no null check visible in source).
Dependencies
- Depends on:
DTS.Common.Interface.Menu.HamburgerMenu(forMenuItemPressedDelegate) - Depends on:
System.Windows.Input(forICommandinterface)
Gotchas
- The
CanExecuteChangedevent is declared but never invoked, meaning subscribers will never be notified of state changes. This is acceptable givenCanExecutealways returnstrue. - No null validation on constructor parameters. Passing a null
menuItemPresseddelegate will cause a runtime exception whenExecuteis called.